Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code exception in contentscript.js (vAPI.setTimeout) when opening Chrome last session tabs that are partly cached #167

Closed
laukstein opened this issue Aug 14, 2018 · 22 comments
Labels
bug Something isn't working fixed issue has been addressed

Comments

@laukstein
Copy link

I am running the latest uBlock Origin on latest stable Chrome, Win10.
I have noticed this issue for a while - when opening Chrome with last tabs session and some of the tabs url server is down, Chrome shows partly cached page (cached HTML, failing on all external files, JS, CSS, etc.) and console shows exception coming from chrome-extension://cjpalhdlnbpafiamejdnhcphjbkeiagm/js/contentscript.js

Uncaught TypeError: Cannot read property 'setTimeout' of undefined

fails in

this.tid = vAPI.setTimeout(this.callback, 20000);

where vAPI suddenly is undefined.

grabilla g14048

@uBlock-user
Copy link
Contributor

uBlock-user commented Aug 14, 2018

failing on all external files, JS, CSS, etc.

Is suspendTabsUntilReady set to true ? Nvm, I can reproduce it even when set to false.

Edit: - I can reproduce it. Console spews this -

@gorhill
Copy link
Member

gorhill commented Aug 14, 2018

What was the URL (as asked in the template) associated with that dev console?

@gorhill
Copy link
Member

gorhill commented Aug 14, 2018

OK I can reproduce with @uBlock-user screenshot, which shows a page from github.com.

@uBlock-user
Copy link
Contributor

I will just post the STR here.

  1. Open chrome://settings/onStartup and select Continue where you left off

  2. Open console, click on gear icon on the extreme right and tick Preserve Log

  3. Visit github.com and once it completes loading close the browser.

  4. Start Chrome again and the browser will connect to github.com and open the console as soon as you can to notice those errors being spewed.

@gorhill
Copy link
Member

gorhill commented Aug 14, 2018

Looks like a Chromium issue to me.

The exception occurs at this line. Yet this line can't possibly be reached if vAPI is undefined -- which is why the exception occurs -- because it is unreachable due to this line not too far above. That code can execute if and only if vAPI is not undefined and of type object.

@uBlock-user
Copy link
Contributor

Indeed, I cannot reproduce on Nightly.

@uBlock-user uBlock-user added bug Something isn't working Chromium specific to Chromium/Chrome labels Aug 14, 2018
@gorhill
Copy link
Member

gorhill commented Aug 14, 2018

Actually, investigating further I find that this line is being executed when I launch the browser -- so correction, that seems to be a uBO issue. I need to keep investigating why this happens.

@gorhill gorhill removed the Chromium specific to Chromium/Chrome label Aug 14, 2018
@uBlock-user uBlock-user added the fixed issue has been addressed label Aug 14, 2018
@gorhill
Copy link
Member

gorhill commented Aug 14, 2018

While investigating #164, I find that the issue was also present with Firefox:

  NS_ERROR_NOT_INITIALIZED: contentscript.js:467 

@uBlock-user
Copy link
Contributor

Did it appear in the console ? I didn't see that when I tried to reproduce twice.

@gorhill
Copy link
Member

gorhill commented Aug 14, 2018

I can't remember what I did for the error to be reported, I was really focused on investigating #164. Now I am unable to find steps to reproduce for Firefox. But given this is the same exact line, I can say that Firefox suffered the same issue.

@laukstein
Copy link
Author

I guess this still haven't landed in stable version. The exception still happens and I see now 1 additional exception in

var userStylesheet = vAPI.userStylesheet;

gorhill/uBlock@dc430f1 probably expected to fix it too.

Here the full log screenshot
grabilla g10932

Actually seems net::ERR_CONNECTION_REFUSED is caused by uBlock Origin, what means isn't related to Chrome cache at all.

@uBlock-user
Copy link
Contributor

No not yet.

Actually seems net::ERR_CONNECTION_REFUSED is caused by uBlock Origin, what means isn't related to Chrome cache at all.

Also that will happen if you have suspendTabsUntilReady set to true

@peterschussheim
Copy link

@gorhill I am experiencing similar errors on all URLs, using Chrome Canary Version 71.0.3556.0 on macOS 10.13.6 (17G65). Would you like me to open a separate issue?

google chrome033

@gorhill
Copy link
Member

gorhill commented Sep 19, 2018

What version of uBO are you using?

@peterschussheim
Copy link

uBO version 1.16.18

@gorhill
Copy link
Member

gorhill commented Sep 19, 2018

The fix has not been released in a stable release yet, it's in the dev build.

@peterschussheim
Copy link

just did some basic tests with dev build and problem appears to be fixed. @gorhill thank you for the prompt response and your work on uBO 👍

@Mouvedia
Copy link

Mouvedia commented Sep 20, 2018

version: 1.16.21.101
browser: Canary 71.0.3556.0

@gorhill It doesn't work if the details' privacy mode switch is on.

@gorhill
Copy link
Member

gorhill commented Sep 20, 2018

details' privacy mode switch is on

I don't know what that means. Please opened a new issue with proper steps to reproduce if you think there is an issue.

@gorhill
Copy link
Member

gorhill commented Sep 20, 2018

I cannot: I am not allowed.

Of course you are allowed, otherwise you wouldn't be able to comment like you are doing now.

As said, I need steps to reproduce, I can't reproduce error message with a private window. Please open a new issue with all the required details in the template.

@Mouvedia
Copy link

Well I wasn't yesterday. It was limited to the contributors.

@gorhill
Copy link
Member

gorhill commented Sep 20, 2018

You are confusing https://github.com/gorhill/uBlock/issues with here -- here is to file issues, the other is reserved to contributors -- as explained in the top opened issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

5 participants