cross browser - Run at document start -
i writing extension need run @ document start. tried placing code outside appapi.ready in extension.js file it's still running late. in chrome use "run_at": "document_start" option. how can same in crossrider extension.
to run code document start, inject script via background.js code using [appapi.dom.ondocumentstart.addjs][1] method. example:
appapi.dom.ondocumentstart.addjs({ js:"alert('hello world!');" });
[disclosure: crossrider employee]
[1] http://docs.crossrider.com/#!/api/appapi.dom.ondocumentstart-method-addjs
Comments
Post a Comment