CrazyEngineers
  • 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
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Home Channels Search Login Register