On Sun, Nov 1, 2009 at 12:50 PM, Philip S. Constantinou <[email protected]> wrote: > Looking at browser actions, is there a recommendation for how to get access > to the DOM of the current tab's DOM (again preferably the DOM window > object). My goal is to take the HTML on the page (either the selection or > the whole window) and write it into the popup with some minor text > transformations. > As you mentioned, I can run a script on the page but can't seem to figure > out how to return data to my extension if there's no shared memory. > It looks like Page Action's have part of what I want (the examples show it > getting access "document" but I'm not sure how to get all this things to > play together.) > Any suggestions would be great.
You can communicate between content scripts and the extension using a message-passing API. See here for information: http://code.google.com/chrome/extensions/content_scripts.html#messaging Also, the RSS reader extension contains a good example of this: http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/data/extensions/samples/subscribe_page_action/ - a --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en -~----------~----~----~----~------~----~------~--~---
