Blocking redirects to ANOTHER domain only

Ask for help about NoScript, no registration needed to post
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

Re: Blocking redirects to ANOTHER domain only

Post by dhouwn »

Really only meta redirects? What about HTTP- and JS-based ones? At least for HTTP-baed ones there's NoRedirect.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20100101 Firefox/9.0
Tom T.
Field Marshal
Posts: 3620
Joined: Fri Mar 20, 2009 6:58 am

Re: Blocking redirects to ANOTHER domain only

Post by Tom T. »

@ dhouwn: Excellent suggestions, thanks. But since OP asked about Meta, will try to answer that. If your add-on fills the OP's needs, very cool. :)
anonymous_user wrote:... I want to block Meta Redirects away from the *current site*, but not within the same domain. The "forbid META redirections" Noscript setting doesnt seem to work at all (I must not understand the details) and Firefox's blocker is too broad, it blocks all redirections.
What version of NoScript are you running? We're having an ongoing problem with this issue at Google searches, for which the fix was to add to the the about:config preference
noscript.forbidMetaRefresh.exceptions
the following:

Code: Select all

^https?://(?:www|encrypted)\.google\.(?:[a-z]{2,3}|[a-z]2\.[a-z]{2,3})/ t.co
For other sites: Note that META is forbidden only inside <noscript> elements -- something the site does when it realizes that its scripting is being blocked. Presumably, if the site is in your whitelist, there shouldn't be a problem. For example, if I allow -- or even temp-allow --- Google scripting (and RequestPolicy as needed), then there are no Meta blocks or warnings, the page works, and the links work, even *without* the above exception.

If you have specific sites in mind that are not in your whitelist, but you want to achieve the above, an exception could no doubt be written, or perhaps a generic one, using regular expressions. Sample site that redirects both away and within its own domain?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Blocking redirects to ANOTHER domain only

Post by therube »

therube wrote:
Presumably, if the site is in your whitelist, there shouldn't be a problem.
AFAIK, that is not so.
NoScript's Forbid META redirections inside <NOSCRIPT> elements is either enabled or not, & not affected by a site's whitelisting.
No that's wrong. A whitelisted site does affect the Forbid META redirections setting.
(Now what was I thinking, & I should have known better?!)

Test page: http://grizzlyweb.com/webmaster/javascripts/examples/redirection.htm
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0a2) Gecko/20111128 Firefox/10.0a2 SeaMonkey/2.7a2
Post Reply