D
D
Deliaz2013-12-13 20:20:24
JavaScript
Deliaz, 2013-12-13 20:20:24

How to track the creation of a property/object in window?

Hello toaster!
I am writing an extension for Google Chrome.
There is a page on which 2 scripts work: site and my content_script .
So, by the time my script loads, window doesn't have the window.blabla property;
How it is possible to trace creation thereof in window besides setInterval?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mikhail Osher, 2013-12-13
@Deliaz

Object.__defineSetter__ not suitable?

N
Nikita Permin, 2013-12-13
@NekitoSP

Isn't it? https://developer.mozilla.org/en-US/docs/Web/JavaS...
"The watch() method watches for a property to be assigned a value and runs a function when that occurs."
I think the usage should look like this: window.watch("blabla", function(id, oldval, newval){...});

D
Deliaz, 2013-12-13
@Deliaz

Found the root of the problem: content_script runs in a separate JS enviroment, so I can't access window extensions directly;
However, on a subject: the offer from Miraage works perfectly!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question