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

Blocking meta refresh redirects #3378

Closed
mowgli opened this issue Dec 28, 2017 · 8 comments
Closed

Blocking meta refresh redirects #3378

mowgli opened this issue Dec 28, 2017 · 8 comments

Comments

@mowgli
Copy link

mowgli commented Dec 28, 2017

This is a dircect followup of #226 as the main issue is not solved.

Describe the issue

I have javascript and cookies fully disabled. On some pages I get now a tracking redirect via meta refresh. This is no popunder so it is not addressed by this filter.

For example:

google.com does redirect to a tracking page where all links are converted to first link to google for redirect to other pages.

twitter does a endless redirect expecting a cookie for tracking is set (what I will never allow for twitter!) to mobile.twitter.com which shows nothing without javascript (What I also will never allow for twitter!)

One or more specific URLs where the issue occurs

Your settings

  • OS/version: Linux
  • Browser/version: Firefox 57.0.1
  • uBlock Origin version: 1.14.22
Your filter lists

Several, the issue is not related to existing filters.

Your custom filters (if any)
www.golem.de###gts-clip > div > .gsap

www.neues-deutschland.de##.Paywall

google.com##^meta[http-equiv="refresh"]

The last was a try to block it but failed, what means that I still see the tracking redirect.

@gorhill
Copy link
Owner

gorhill commented Dec 28, 2017

google.com##^meta[http-equiv="refresh"]

The last work only on my local build, I did not commit the code yet.

gorhill added a commit that referenced this issue Dec 28, 2017
A new filtering class has been created: "static extended filtering".
This new class is an umbrella class for more specialized filtering
engines:
- Cosmetic filtering
- Scriptlet filtering
- HTML filtering

HTML filtering is available only on platforms which support modifying
the response body on the fly, so only Firefox 57+ at the moment.

With the ability to modify the response body, HTML filtering has
been introduced: removing elements from the DOM before the source
data has been parsed by the browser.

A consequence of HTML filtering ability is to bring back script tag
filtering feature.
@gorhill
Copy link
Owner

gorhill commented Dec 28, 2017

Fixed with a9f68fe, will be in 1.14.23b3, the filter google.com##^meta[http-equiv="refresh"] should work. This requires Firefox 57+.

@gorhill gorhill closed this as completed Dec 28, 2017
@mowgli
Copy link
Author

mowgli commented Dec 28, 2017

Works pretty well, thanks.

google.com##^meta[http-equiv="refresh"]
google.com##^noscript > style
twitter.com##^meta[http-equiv="refresh"]

@gorhill
Copy link
Owner

gorhill commented Dec 30, 2017

When I fixed #3069, the original intention was to allow to inject scriptlets before any other script tags on a page, thus removing the issue of potential race condition which could cause the inject scriptlets to not perform their duty.

While I worked with the new Firefox 57 API to fix #3069, I realized that it would also be great to be able to support element removal using cosmetic filter-like syntax before the browser can even parse the source, since with #3069 the response data was already being modified.

However there was no issue opened for such feature. So I will use the feature request here a posteriori in the release notes as the rationale for the new HTML filtering feature.

@LeetCodes
Copy link

how do i block meta refresh in chrome? i dont care if i have to block every single meta tag temporarily, im getting so frustrated with twitter refreshing on any cache or archive, im raging...
is it not possible to block meta refresh on chrome whatsoever? that seems to be the consensus online, i've been screaming for 2 hours trying to just load cache:https://twitter.com/ without being redirected to fucking mobile, do you have any suggestions? i guess im going to setup a local web proxy and regex replace the traffic or just download firefox.. but id like to do it with filter on chrome

@gorhill
Copy link
Owner

gorhill commented Jan 2, 2018

is it not possible to block meta refresh on chrome whatsoever?

For twitter, the meta http-equiv="refresh" tag is inside a noscript tag. So just disable noscript spoofing for twitter.com?

@LeetCodes
Copy link

just disable noscript spoofing

how do i do that?
i tried adding the rule
no-strict-blocking: twitter.com true
but it still redirects

@gorhill
Copy link
Owner

gorhill commented Jan 2, 2018

My bad, I got confused and thought I was commenting on a uMatrix issue, somehow.

So you are blocking javascript with Chrome's own javascript blocker? If so, you could instead block javascript on twitter with uBO, and enable javascript on twitter in Chrome settings. I tried it and it works fine for me, there was no redirection -- the noscript tags are no spoofed by uBO.

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