How do iframes work in Google Chrome “New Tab”?

You know, 8 small frames that show your most visited websites. How do they get snapshots of websites? How do they decide which websites to use? How do they work?

Edit: so that I can do something like this.

Edit 2: This is not programming? I ask how to encode an iframe that takes a snapshot of websites.

+4
source share
2 answers

Using an internal method that shows an image (in this particular case; chrome-search://thumb/53/22)? Have you looked at the source?

<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="common.css">
        <link rel="stylesheet" href="thumbnail.css">
        <script src="util.js"></script>
        <script src="thumbnail.js"></script>
    </head>

    <body dir="ltr">
        <a href="http://www.reddit.com/" ping="/log.html?pos=1" title="reddit: the front page of the internet" target="_top" tabindex="-1" style="color: rgb(119, 119, 119); font-size: 11px; font-family: arial, sans-serif;">
            <span class="shadow"></span>
            <!-- RIGHT HERE! -->
            <img src="chrome-search://thumb/53/22">
        </a>
    </body>
</html>

Take a look chrome-search://most-visited/thumbnail.js:

    function createThumbnail(src) {...} // creates the thumbnails

you can try to delete the contents

    function showDomainElement() {} 

. .

+2

. , html2image, DOMPDF ..

0

All Articles