Page-Worker everytime URL changes

17 views
Skip to first unread message

SaraC

unread,
Sep 7, 2011, 2:10:07 AM9/7/11
to mozilla-labs-jetpack

Hi, I'm doing a bit of screen scraping everytime the user gets to a
new page by using a page-worker pointed at the url. Looking for a way
in main.js to tell that the page has changed so I can re-run the page-
worker script. However, there doesn't seem to be an intuitive way. I
tried to keep tabs.activeTab.url in a variable and run a comparison on
an interval, but for some reason that kept returning true (this may be
a syntax error on my part). Any thoughts on a good way to track when
the page is changed? I tried doing the onAttach of a content script,
but that ran several times a page, apparently.

SaraC

unread,
Sep 7, 2011, 8:31:55 PM9/7/11
to mozilla-labs-jetpack
Basically, I'm looking to use a page-worker everytime the url changes.
Thoughts?

Wes Kocher

unread,
Sep 7, 2011, 8:41:47 PM9/7/11
to mozilla-la...@googlegroups.com
I think using a pagemod set up to run on "*" would be the easiest way.

I think this thread on the forums shows how to not have the script run multiple times on each page load, if I understood what you were talking about correctly.

On Wed, Sep 7, 2011 at 7:31 PM, SaraC <saraj...@gmail.com> wrote:
Basically, I'm looking to use a page-worker everytime the url changes.
Thoughts?

--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-la...@googlegroups.com.
To unsubscribe from this group, send email to mozilla-labs-jet...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mozilla-labs-jetpack?hl=en.


Reply all
Reply to author
Forward
0 new messages