aghorler / LoadTabOnSelect

Load newly-opened background tabs in Firefox on selection, rather than automatically in the background.
Apache License 2.0
13 stars 4 forks source link

The extension should ignore file:/// urls and any other illegal urls. #7

Open UnCrevard opened 6 years ago

UnCrevard commented 6 years ago

Hi,

LoadTabOnSelect is unable to restore these urls. So they're get stuck and moz-extension must be removed by hand.

Due to the fact :

For security reasons, in Firefox, this may not be a privileged URL. So passing any of the following URLs will fail, with runtime.lastError being set to an error message:

chrome: URLs javascript: URLs data: URLs file: URLs (i.e., files on the filesystem. However, to use a file packaged inside the extension, see below) privileged about: URLs (for example, about:config, about:addons, about:debugging, about:newtab). Non-privileged URLs (about:home, about:blank) are allowed.

I think it would be smarter that the extension's index.html page use some javascript listening onFocus or from background (onActived) then use window.location.replace to restore the url.

It's hacky way to bypass webext policy.

Thanks