简体   繁体   中英

chrome example extension not working

I have downloaded the code as it is from this link from chrome site

And tried to load the extension however the images do not get loaded and a small rectangle box is displayed.I tried to follow this link but no such error is present in the file i downloaded.Can anyone help please?

Quick Google search of that error and based on its description, it's a problem with the app's API key for Flickr . You can find the key in the example code at line 25.

searchOnFlickr_: 'https://secure.flickr.com/services/rest/?' +
  'method=flickr.photos.search&' +
  'api_key=90485e931f687a9b9c2a66bf58a3861a&' +

I encountered this before with this kittens example and you have to wait until the key is reactivated. I'd suggest just getting started with another simple sample , such as "A browser action with a popup that changes the page color".

What I did:

  1. Go to "popup.js", find the query url, concatenate it, paste it to browser, found out the API key expired
  2. Search for "Flickr API key register", go to the registration page
  3. Register for a Yahoo account
  4. Register a Flickr API key using that Yahoo account
  5. Replace the old API key in the query url with the one you just created, and enter that in the browser, confirm that it works
  6. Replace the old API key in the popup.js with the new one
  7. Now when you click the extension button again, it should show kitten pictures.

Finding out where the problem lies is not as hard as you may think.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM