Google Chrome 13 Content Scripts And Proxy Management Get Revamp

Cross-origin XMLHttpRequest calls with extension facility directly from your content script is now possible with Google Chrome 13.
You will no longer need to relay these requests through a background page; this should simplify your code. In some cases, it may even eliminate your need to use a background page.

Here’s a #-Link-Snipped-# which demonstrates the old way a content script could make a cross domain request. As you can see, the extension required a [chrome] Contents of /trunk/src/chrome/common/extensions/docs/examples/howto/contentscript_xhr/background.html to route the cross-origin calls through a chrome.extension.onRequest listener.
This also means that Greasemonkey scripts that use GM_xmlhttpRequest - such as the classic Dance Party - will now work in Chrome.


Second, Google Chrome team improved how #-Link-Snipped-# work.
Until this release you could specify a matches array for your content script - the URLs over which it should operate. In Chrome 13 you can now also specify an exclude_matches array, where you can indicate the pages in which your content scripts should not work. This should allow more precise targeting of your content script.


Finally, they added support for the Talk:Metadata Block - GreaseSpot Wiki command for imported Greasemonkey scripts, so you can control when your script is loaded in the same way you’ve been able to do for content scripts. Running scripts at different points in a page's lifecycle can enable additional functionality. For example, they've written [chrome] Contents of /trunk/src/chrome/common/extensions/docs/examples/howto/userscript-runat/runat.user.js which runs at "document-start" and lists all of the HTTP resources included in the current page.


Moreover, with the #-Link-Snipped-#, you can now configure proxy settings by choosing from several options including auto detection, the host OS’s system default, PAC scripts or fixed #-Link-Snipped-#.


These new configuration options allow for more fine grained proxy controls, which we invite you to try out. There are already several 3rd party extensions available in the Chrome Web Store that showcase the API and its new capabilities, including #-Link-Snipped-# and #-Link-Snipped-#.

Source: #-Link-Snipped-#

Replies

You are reading an archived discussion.

Related Posts

'Find My Mac' is the service that is very similar to 'Find My iPhone' with the only difference that since Mac has no GPS functionality, this service will rely on...
Google placement process in past have consisted of 3 rounds. 1. English 2. General Aptitude 3. Technical Questions 4. Analysis Test If you clear all the tests, you go on...
Your twitter account will be soon upgraded to the new twitter. These are the new features of New Twitter: In the new design you will find @mentions, retweets, searches, and...
I believe the Selection procedure of Zensar Technologies is same as that of other companies: 1) Aptitude Test 2) Technical Interview 3) HR Interview Could anyone share the placement paper...
Those who have taken the New GRE test, from August 1, please share your experience here: 1. New pattern style 2. Questions Appeared 3. Difficulty level 4. Which books/material helped...