Hi,
I found out what was the problem that made me use the
viewFor(windows.activeWindow).content.document.location.href code to get
the current url. It is related to require("sdk/tabs").activeTab not
working well when popup windows are involved which is often the case in
many video sites (bugs #942511, #989288, #1003988).
Fortunately,
require("sdk/windows").browserWindows.activeWindow.tabs.activeTab.url
does the trick.
Version 5.4.0a5 available from
http://www.downloadhelper.net/install-beta.php?version=5.4.0a5 has those
clumsy CPOW calls removed.
Best,
/mig
On 23/05/2015 01:08, Michel Gutierrez wrote:
>
> I agree doing
>
> try {
> currentUrl =
> viewFor(windows.activeWindow).content.document.location.href;
> } catch($_) {}
>
> doesn't seem to make much sense as 'var currentUrl =
> tabs.activeTab.url;' executed just before should do the job.
>
> However, i had to add this code because getting tabs.activeTab.url was
> not always working. I don't remember the specifics exactly. I will
> remove this code, see if i can reproduce the problem whatever it is and
> if it has not been fixed by the latest Firefox releases (i wrote this
> code when Fx 36 was the latest official). I will then find another
> workaround that does not need CPOW.
>
> Best,
> /mig