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

Buttons don't respond on strict blocking warning pages. #806

Closed
rumorumo opened this issue Oct 9, 2015 · 20 comments
Closed

Buttons don't respond on strict blocking warning pages. #806

rumorumo opened this issue Oct 9, 2015 · 20 comments

Comments

@rumorumo
Copy link

rumorumo commented Oct 9, 2015

I'm using Chrome 31.0.1650.63 (a bit old, I know, but...). Since uBlock 1.1.0.0 the buttons on strict blocking warning pages have stopped responding to mouse and keyboard (links still work). The only way of accessing blocked sites is whitelisting them manually on the dashboard...

Thank you for all the great work in uBlock!

@lewisje
Copy link

lewisje commented Oct 9, 2015

IIRC there's no platform where Chrome 31 works but Chrome 45 doesn't, so I don't know why you're still using Chrome 31; I do know that Chrome dropped support for OS X Leopard after 21, and for Debian 6 after 27, but I haven't seen any drop in platform support after 31.

I guess rare cases like yours would lead to the desire to be able to download an older version of a Chrome extension from the store, and to keep extensions from updating to known-incompatible versions.

@gorhill
Copy link
Owner

gorhill commented Oct 9, 2015

I suppose there are error messages in the dev console of the "strict blocking" page? (Ctrl-Shift-I)

@rumorumo
Copy link
Author

rumorumo commented Oct 9, 2015

Maybe this: "Uncaught TypeError: Cannot read property 'length' of undefined"?

@rumorumo
Copy link
Author

rumorumo commented Oct 9, 2015

"document-blocked.js:201".

@gorhill
Copy link
Owner

gorhill commented Oct 9, 2015

You have a line number with the error message?

@rumorumo
Copy link
Author

rumorumo commented Oct 9, 2015

"Line 201, Column 1" appears above the error message when I click on "document-blocked.js:201".

And this is shown as line 201: " if ( url === null || url.search.length === 0 ) {".

@lewisje
Copy link

lewisje commented Oct 9, 2015

I guess more defensive coding is in order: if (!url || !url.search || !url.search.length) { (or other idioms as appropriate).

@rumorumo
Copy link
Author

Sorry, I was caught yesterday as non-human by a GitHub robot and my profile was blocked in the middle of the conversation... Now I'm back. Is there anything more I can help about this issue?

@gorhill
Copy link
Owner

gorhill commented Oct 10, 2015

more defensive coding is in order

Except that this doesn't explain why the error occurs. url should be null or an instance of URL -- which object has a search property. According to the reported error, url is not null, but somehow url.search does not exist.

Is there anything more I can help about this issue?

Can you try this javascript snippet in the browser console (any one will do)? (paste at the bottom of the console, hit enter, see result).

var u = (URL || webkitURL); var a = null; try { a = new URL('https://toto.com/'); } catch(e) {}; a.search.length;

@rumorumo
Copy link
Author

The result: "TypeError: Cannot read property 'length' of undefined".

@gorhill
Copy link
Owner

gorhill commented Oct 11, 2015

Can you try:

var u = (URL || webkitURL); var a = null; try { a = new URL('https://toto.com/'); } catch(e) {}; a;

Then expand the result to see the listed properties? For example, on my side I get:

var u = (URL || webkitURL); var a = null; try { a = new URL('https://toto.com/'); } catch(e) {}; a;
URL {}
    hash: ""
    host: "toto.com"
    hostname: "toto.com"
    href: "https://toto.com/"
    origin: "https://toto.com"
    password: ""pathname: "/"
    port: ""protocol: "https:"
    search: ""
    username: ""
    __proto__: URL

@rumorumo
Copy link
Author

The result here is "URL {}" too, but I don't know how to expand it...

@lewisje
Copy link

lewisje commented Oct 13, 2015

In Chrome, you should see a ▶ symbol, that when clicked will expand the list of properties; in other modern browsers, the interface is similar.

@rumorumo
Copy link
Author

Here in my console I don't see such symbol.

@gorhill
Copy link
Owner

gorhill commented Oct 13, 2015

Try replacing the trailing a; with console.log('%o', a);

@rumorumo
Copy link
Author

Here is what I get (there are many more levels of expansion, tell me how further I have to go):

var u = (URL || webkitURL); var a = null; try { a = new URL('https://toto.com/'); } catch(e) {}; console.log('%o', a);
    URL
        __proto__: URL
            constructor: function URL() { [native code] }
                arguments: null
                caller: null
                createObjectURL: function createObjectURL() { [native code] }
                length: 0
                name: "URL"
                prototype: URL
                revokeObjectURL: function revokeObjectURL() { [native code] }
                toString: function toString() { [native code] }
                __proto__: function Empty() {}
                <function scope>
            __proto__: Object
                __defineGetter__: function __defineGetter__() { [native code] }
                __defineSetter__: function __defineSetter__() { [native code] }
                __lookupGetter__: function __lookupGetter__() { [native code] }
                __lookupSetter__: function __lookupSetter__() { [native code] }
                constructor: function Object() { [native code] }
                hasOwnProperty: function hasOwnProperty() { [native code] }
                isPrototypeOf: function isPrototypeOf() { [native code] }
                propertyIsEnumerable: function propertyIsEnumerable() { [native code] }
                toLocaleString: function toLocaleString() { [native code] }
                toString: function toString() { [native code] }
                valueOf: function valueOf() { [native code] }
                get __proto__: function __proto__() { [native code] }
                set __proto__: function __proto__() { [native code] }
undefined

@gorhill
Copy link
Owner

gorhill commented Oct 13, 2015

Thanks, this explains the problem. Could you try one last js snippet to confirm the fix?

var u = (webkitURL || URL); var a = null; try { a = new URL('https://toto.com/'); } catch(e) {}; console.log('%o', a);

@rumorumo
Copy link
Author

var u = (webkitURL || URL); var a = null; try { a = new URL('https://toto.com/'); } catch(e) {}; console.log('%o', a);
    URL
        __proto__: URL
            constructor: function URL() { [native code] }
                arguments: null
                caller: null
                createObjectURL: function createObjectURL() { [native code] }
                length: 0
                name: "URL"
                prototype: URL
                revokeObjectURL: function revokeObjectURL() { [native code] }
                toString: function toString() { [native code] }
                __proto__: function Empty() {}
                <function scope>
            __proto__: Object
                __defineGetter__: function __defineGetter__() { [native code] }
                __defineSetter__: function __defineSetter__() { [native code] }
                __lookupGetter__: function __lookupGetter__() { [native code] }
                __lookupSetter__: function __lookupSetter__() { [native code] }
                constructor: function Object() { [native code] }
                hasOwnProperty: function hasOwnProperty() { [native code] }
                isPrototypeOf: function isPrototypeOf() { [native code] }
                propertyIsEnumerable: function propertyIsEnumerable() { [native code] }
                toLocaleString: function toLocaleString() { [native code] }
                toString: function toString() { [native code] }
                valueOf: function valueOf() { [native code] }
                get __proto__: function __proto__() { [native code] }
                set __proto__: function __proto__() { [native code] }
undefined

@gorhill
Copy link
Owner

gorhill commented Oct 13, 2015

Ugh, sorry, there was a mistake in my js snippet. Can you rather try:

var U = (webkitURL || URL); var a = null; try { a = new U('https://toto.com/'); } catch(e) {}; console.log('%o', a);

@rumorumo
Copy link
Author

var U = (webkitURL || URL); var a = null; try { a = new U('https://toto.com/'); } catch(e) {}; console.log('%o', a);
    URL
        __proto__: URL
            constructor: function URL() { [native code] }
                arguments: null
                caller: null
                createObjectURL: function createObjectURL() { [native code] }
                length: 0
                name: "URL"
                prototype: URL
                revokeObjectURL: function revokeObjectURL() { [native code] }
                toString: function toString() { [native code] }
                __proto__: function Empty() {}
                <function scope>
            __proto__: Object
                __defineGetter__: function __defineGetter__() { [native code] }
                __defineSetter__: function __defineSetter__() { [native code] }
                __lookupGetter__: function __lookupGetter__() { [native code] }
                __lookupSetter__: function __lookupSetter__() { [native code] }
                constructor: function Object() { [native code] }
                hasOwnProperty: function hasOwnProperty() { [native code] }
                isPrototypeOf: function isPrototypeOf() { [native code] }
                propertyIsEnumerable: function propertyIsEnumerable() { [native code] }
                toLocaleString: function toLocaleString() { [native code] }
                toString: function toString() { [native code] }
                valueOf: function valueOf() { [native code] }
                get __proto__: function __proto__() { [native code] }
                set __proto__: function __proto__() { [native code] }
undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants