Skip navigation.

exploreopera

| Help

Sign up | Help

Arena - blog

Los amigos del barrio pueden desaparecer, pero los dinosaurios van a desaparecer

Posts tagged with "newspaper"

UserJS for regional newspapers

, ,

When one publisher owns a couple of regional newspapers, it is to be expected that all related sites will use the same methods to annoy Opera users. The script to fix the issue is shorter than the list of sites to which it applies :smile:
I haven't been able to get it working using the easiest method to list the relevant websites, namely

// ==UserScript==
// @include...
// ==/UserScript==

But the script below does the trick anyway:

if (window.location.href.indexOf('http://www.leidschdagblad.nl')>-1 || window.location.href.indexOf('http://www.limburgsdagblad.nl/')>-1 || window.location.href.indexOf('http://www.telegraafholding.nl')>-1 || window.location.href.indexOf('http://www.hdcmedia.nl')>-1 || window.location.href.indexOf('http://www.limburgadverteren.nl')>-1 || window.location.href.indexOf('http://www.nhd.nl/')>-1 || window.location.href.indexOf('http://www.gooieneemlander.nl/')>-1 || window.location.href.indexOf('http://www.haarlemsdagblad.nl/')>-1 || window.location.href.indexOf('http://www.ijmuidercourant.nl/')>-1 || window.location.href.indexOf('http://www.dvhn.nl')>-1 || window.location.href.indexOf('http://www.vakantierecreatie.nl/')>-1 || window.location.href.indexOf('http://www.almerevandaag.nl/')>-1){
    window.opera.defineMagicVariable(
        'bSupportedBrowser',
        function(){return true;},
        null);
}

First UserJS - avoiding browser sniffer on Trouw.nl

, ,

Edit: Trouw now has a new website with its own problems; the browser sniffer has been removed

Trouw.nl has a very annoying browser sniffer - one that has only three options: you're either IE, or Mozilla, or you don't support JavaScript. No need to explain Opera has troubles with the site. (Discussion in the Dutch part of the forums: <http://my.opera.com/forums/showthread.php?s=&threadid=67390>)

I took the UserJS file Rijk posted in his journal as an example (http://my.opera.com/Rijk/journal/54) and added a function that will let you use trouw.nl without having to id as IE. Take a look at Rijk's script to correctly interpret the following lines:

domainHandler['www.trouw.nl'] = screwSniffing01;

function screwSniffing01() {
var str=document.body.getAttribute('onload');
if(str.indexOf('ververs')>=0) {
str=str.replace("ververs('","").replace("')","");
location.replace(str);
}
}

Of course, this is for OperaBeta 3+ only.