-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unable to block websockets #956
Comments
Blocking inline script does get rid of the ad, if whatever side effects is acceptable to you. |
Oh, okay. I'll star+hope for a fix. Thanks. |
Fixed with 2d26d1d. |
@gorhill thanks for fixing this, Did Chrome fix chrome.webRequest.onBeforeRequest? |
Look at the latest version, the syntax checking is done in https://github.com/gorhill/uBlock/blob/master/platform/chromium/websocket.js. For the particular point "a bit faster", I don't know how much faster this was, what is 100% sure though, is this is needless overhead, one which can be avoided -- javascript which won't have to be executed needlessly in the content script world. |
@dungsaga Code generation (by which I mean running code without the context in which it was defined, eg. through stringification) can yield significant speed benefits in JS in some cases, although it's definitely something you'd have to measure on a per-case basis. Other performance-critical libraries like Bluebird do something similar. |
I like their multi-lines solution, I think I will adopt it. |
The multi-line string style (like Bluebird) looks much cleaner. |
Try it. I will accept a pull request if you actually implement your idea of how it should be made. |
FYI, this has been fixed starting in Chrome 58: https://bugs.chromium.org/p/chromium/issues/detail?id=129353#c87 |
It's great. We can say goodbye to uBlock Origin Extra soon. |
(ublock origin 1.3.3, chrome 46.0.2490.86, custom blocklists, otherwise default settings)
Hi. I'm trying to craft a rule to block a websocket connection. I don't appear to be able to do so.
Putting even something terrible like
|ws://
in a block list does not appear to work. Is this because ALL websockets are considered behind-the-scene connections and thus in the default whitelist?I have also tried removing that line from the default whitelist, and it still fails to block the connection.
I enabled advanced user mode, which also did not appear to help.
There is an advert network (rev defender) which uses this technique. When the other ads on the page fail to display (as they are wont to do), it forms a websocket connection, over which it delivers the ads as a data: url to be written into the page. Blocking websockets generally (see above), and the domain the connection is made to, does not appear to work.
For a good example of this behavior, try any page on
opensubtitles.org
.Is there any guidance you can provide, or are we SOL for blocking this technique?
The text was updated successfully, but these errors were encountered: