Sadly, Google made it harder impossible to install the flickr creative commons attribution helper script directly from the Userscripts site. As alerted by George Couros, clicking that Install button in Chrome now gives you:

Apparently in the name of “security” Google is taking a page from Apple:

We’re constantly looking out for ways to make your browsing safer. To that end, we recently changed the way you add extensions that are not in the Chrome Web Store to your browser. Previously, any website could prompt you to add an extension into your browser. In the latest version of Google Chrome, you must explicitly tell Chrome that you want to install these extensions by adding them through the Extensions page.

To help keep you safe on the web, we have started analyzing every extension that is uploaded to the Web Store and take down those we recognize to be malicious. Unfortunately, we don’t have the ability to take down malicious items promoted on other websites. For instance, online hackers may create websites that automatically trigger the installation of malicious extensions. Their extensions are often designed to secretly track the information you enter on the web, which the hackers can then reuse for other ill-intended purposes.

The updated installation process prevents websites from automatically triggering unauthorized extension installations and gives you more control over the extensions you’re adding to Chrome.

I bet it took 18 lawyers to write that.

Anyhow, this sent me down the path of having to learn how to package the javascript as a Google Chrome package that could be uploaded to the store, and that was not all trivial.

The core of it was a manifest.json file which provided it some specs. Each time I uploaded it, I got an error saying the file had an error, but it was not specific. So I kept trying to re-edit it, but could never get it past the uploader.

Today, i was fishing around the extensions listing (since the drag and drop of the javascript did not work like their docs suggested), and I saw this button for “pack extension”:

I selected the zip archive, and voila! This time, it told reported the error as an extraneous comma at the end of an array list. For what it is worth, here is the code that worked in manifest.json:

{
  "name": "Flickr CC Attribution Helper",
  "version": "0.51",
  "manifest_version": 2,
  "description": "Generates attribution strings for creative commons licensed flickr images",
  "icons": { "16": "icon16.png",
           "48": "icon48.png",
          "128": "icon128.png" },
  "content_scripts": [
    {
      "matches": ["http://www.flickr.com/photos/*/*", 
            "http://flickr.com/photos/*/*"],
      "exclude_matches": ["http://www.flickr.com/photos/*/*#preview",
             "http://flickr.com/photos/*/*#preview"],
      "js": ["flickr_cc_attribution_helper.js"]
    }
  ]
}

I cleaned this up, and was able to upload the Flickr CC Attribution Helper Extension to the Chrome Store:

I wanted to test it, but did not want to muck up the working copy in my main browser, so I logged into another account on my laptop, and was able to install the extension, and verify it worked in flickr (I do note that it only works if you are logged into flickr).

This was some extra leg work, and I am not 100% sure I got it all done correctly, so I would appreciate some folks testing out this new installer.

The post "Installing Flickr CC Attribution Helper from Google Chrome Store" was originally thawed from a previous ice age and melted at CogDogBlog (https://cogdogblog.com/2012/09/flickr-cc-attribution-helper-chrome-store/) on September 15, 2012.

6 Comments

Leave a Comment

All fields are required. Your email address will not be published.