Welcome guest, is this your first visit? Create Account now to join.
Results 1 to 2 of 2

This is a discussion on get reference to the document object from background.html within the Plugins Development section, part of the Chrome Plugins category: I have a js that resides in the background.html and from that js code I need to get access to ...


  1. #1
    itomatik is offline Junior Member
    Join Date
    Nov 2010
    Posts
    1

    Default get reference to the document object from background.html

    I have a js that resides in the background.html and from that js code I need to get access to the document object of the current tab (when the event is fired) in order to make series of modifications/access to the various document fields. I don't seem to find a convenient way to do this task.

    Ideally, I would like to have some sort of reference to the document object passed to the background.html js code.

    I know there are content scripts that you can launch on particular page. But I don't see how can I send a reference to the document object of the current tab from the content_script.

    Any suggestions on how to do it?

  2. #2
    devnull69 is offline Member
    Join Date
    Jul 2010
    Posts
    32

    Default

    You just can't do that. You'll have to do all document manipulation tasks inside the content script for Chrome security reasons. You can use message passing to send data (like strings, integers, javascript objects) from content script to background.html and vice versa.

Similar Threads

  1. Refreshing background.html? localStorage issue
    By bryanosaurus in forum Plugins Development
    Replies: 5
    Last Post: 05-18-2010, 09:49 PM
  2. Access to DOM(Document Object Model)
    By chello in forum Plugins Development
    Replies: 7
    Last Post: 05-10-2010, 10:18 AM
  3. An actually complete and well document API reference. O.o
    By Waha in forum Plugins Development
    Replies: 1
    Last Post: 09-04-2009, 05:28 AM
  4. Get the reference of active window
    By Gaurang033 in forum Plugins Development
    Replies: 1
    Last Post: 06-02-2009, 07:11 AM
  5. Get the reference of active window
    By Gaurang033 in forum Chrome Plugins
    Replies: 1
    Last Post: 06-02-2009, 07:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •