Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CPOWs in Video DownloadHelper

48 views
Skip to first unread message

Bill McCloskey

unread,
May 22, 2015, 6:31:38 PM5/22/15
to michel.g...@gmail.com, dev-tech-electrolysis, Giorgio Maone
Hi Michel,

I was looking at some of the CPOWs in Video DownloadHelper. Most of them
come from the add-on SDK, which we at Mozilla need to fix. However, I
noticed that hits.js includes this code:

function UpdateCurrentUrl() {
var t = tabs.activeTab.url;
try {
t = viewFor(windows.activeWindow).content.document.location.href
} catch (i) {}
var e = {};
for (var r in tabs) e[tabs[r].url] = 1;
for (var s in hits) {
var a = hits[s];
"active" == a.status && a.data.topUrl != t ?
a.setStatus(a.data.topUrl in e ? "inactive" :
}
}

The code in the try/catch block will use a CPOW and it seems to run pretty
frequently. Is there any chance you could just remove that line? It seems
like tabs.activeTab.url should return the same data.

Thanks,
Bill

Bill McCloskey

unread,
May 22, 2015, 6:48:37 PM5/22/15
to Michel Gutierrez, dev-tech-electrolysis, Giorgio Maone
Sure, however you would normally make a change like this.
Thanks!
-Bill

On Fri, May 22, 2015 at 3:42 PM, Michel Gutierrez <
michel.g...@gmail.com> wrote:

>
> Hi Bill,
>
> Sure, i should be able to do things another way here. Do you want to open
> a bug on this ?
>
> Thanks,
> /mig

Michel Gutierrez

unread,
Jun 5, 2015, 8:14:10 AM6/5/15
to bi...@mozilla.com, dev-tech-electrolysis, Giorgio Maone

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

Bill McCloskey

unread,
Jun 5, 2015, 10:30:41 AM6/5/15
to Michel Gutierrez, dev-tech-electrolysis, Giorgio Maone
Thanks so much!

Виноградов Сергей

unread,
Jun 20, 2015, 7:27:28 PM6/20/15
to dev-tech-electrolysis
Hello

A couple of months ago I was working with version 40 of FireFox Nightly. document-element-inserted and the content-policy events in the chrome process was not displaying the loading of web pages.

Now with version 40 DE FireFox I see that in chrome the process there are challenges related to download web content (http://*) (with e10s enabled).


I build extension with "jpm xpi" command with "permissions": {"private-browsing": true, "multiprocess": true} in package.json .
I don't understand why I see this behavior.

Something has changed in FireFox or I have incorrectly set up the jpm build?
0 new messages