Listen to URL location firefox extension
I need to detect when the user changes to a PDF page, for example: w4 Form. I know how to get the URL of the current page by either using document.location.href
or document.URL
. They both work fine, however when a PDF page is loaded those calls do not work.
I am inserting a content script through page-mod
. The code is the following:
var pageMod = require("page-mod");
pageMod.PageMod({
include: "*",
contentScriptWhen: 'start',
contentScript: 'console.log(document.location.href);'
});
So I am guessing that you cannot insert a content script into a PDF page. What alternatives do I have to detect when a user is inside a PDF page?
In Chrome I am able to do this by assigning a background page. Is there a similar way to do this with the Add-on SDK? I looked at page-worker
but I couldn't find anyt开发者_StackOverflow社区hing there either since it is just an invisible page and not a background page.
精彩评论