Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1101547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:03:06+00:00 2026-05-17T01:03:06+00:00

For instance, if I input: http://www.google.com/ It would return: http://www.google.com/images/logos/ps_logo2.png Using javascript/jquery. These sites

  • 0

For instance, if I input:
http://www.google.com/

It would return:
http://www.google.com/images/logos/ps_logo2.png

Using javascript/jquery. These sites would all be external. Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:03:07+00:00Added an answer on May 17, 2026 at 1:03 am

    Since that is a Google Chrome extension, you are not bound to same origin policy.

    Basically, you would need content scripts to fetch all the images within a page, and check each image’s size within the DOM to know if its larger the last fetched image.

    You can use Message Passing, to communicate from the Content Script to the popup/background page.

    For example, I will show you how to get the largest image from a page and show it within the popup. We use all the techniques shown above and you will see the largest image within the popup if you activate it. (should show I believe :))

    manifest.json (snippet)

     ...
    
     "permissions": [
       "tabs",
       "http://*/*"
     ],
      "content_scripts": [
      {
        "matches": ["http://*/*"],
        "js": ["images.js"],
        "run_at": "document_start",
        "all_frames": true
      }
     ]
    
    ...
    

    popup.html

    <!DOCTYPE html> 
    <html>
    <head>
    <script>
    function getImage() {
      chrome.tabs.getSelected(null, function(tab) {
        chrome.tabs.sendRequest(tab.id, {method: "getImage"}, function (response) {
          var text = document.getElementById('image'); 
          var image = response.data;
          text.src = image ? response.data : 'no_image.gif';
        });
      });
    }
    </script>
    </head>
    <body>
    <button onclick="getImage(); ">Get Largest Image</button>
    <img src="no_image.gif" id="image"/>
    </body>
    </html>
    

    images.js (content script)

    function getMaxImage() {
      var maxDimension = 0;
      var maxImage = null;
    
      // Iterate through all the images.
      var imgElements = document.getElementsByTagName('img');
      for (var index in imgElements) {
        var img = imgElements[index];
        var currDimension = img.width * img.height;
        if (currDimension  > maxDimension){
           maxDimension = currDimension
           maxImage = img;
        }
      }
      // Check if an image has been found.
      if (maxImage) 
        return maxImage.src;
      else
        return null;
    }
    
    // Listen for extension requests.
    chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
      if (request.method == "getImage") {
        sendResponse({data: getMaxImage()});
      } else {
        sendResponse({}); // snub them.
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded the selenium-java-2.0a5.zip http://code.google.com/p/selenium/downloads/list and ran the following code: package org.openqa.selenium.example; import org.openqa.selenium.By;
Take for instance this XHTML snippet: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
I am wanting to do something similar to this: http://www.dimarzio.com/pickup-picker My question involves the
I'm using this wsdl-file to describe my webservice: <?xml version=1.0 encoding=UTF-8 ?> <wsdl:definitions targetNamespace=http://www.myapproach.de/knowledgebase
i have following xml file as input .... <?xml version=1.0 encoding=ISO-8859-1?> <T0020 xsi:schemaLocation=http://www.safersys.org/namespaces/T0020V1 T0020V1.xsd
I created a function to take location input, pass it to Google Maps Javascript
This my function public string getMD5hash(string input) { //create a new instance of MD5
HTML5 Anyway to include a submit button directly into a input type=text? For instance
I get a problem about returning phone keypads. For instance, if I input 1-80-0Apple,
instance Monad (Either a) where return = Left fail = Right Left x >>=

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.