User JavaScript in Opera 8 final
Wednesday, April 20, 2005 10:34:02 AM
The limitation first: because we are worried about potential spyware abuse, User JavaScripts will not run on pages that are encrypted. This is a big and very annoying limitation, and we're thinking hard about what we can do about it.
Now the enhancements: you can tell Opera to load all files in a folder as User JavaScripts, Opera has a GreaseMonkey-compatible mode to take full advantage of GreaseMonkey scripts with minimal or no editing, and there are new functions that simplify fixing pages: window.opera.defineMagicVariable and window.opera.defineMagicFunction lets you set persistent variables and functions that the page can not overwrite.
For more information about User JavaScript, see
http://my.opera.com/hallvors/journal/44
http://my.opera.com/hallvors/journal/45
<http://people.opera.com/rijk/opera/userjs.html>
and the brand new tutorial on
<http://www.opera.com/support/tutorials/userjs/>
which has several demo scripts and covers all the new and old features.









scipio # Wednesday, April 20, 2005 10:34:02 AM
Robert Błautquiris # Wednesday, April 20, 2005 10:34:02 AM
// ==UserScript==
// @include http://wp.pl/*
// ==/UserScript==
alert('test');
It should load alert window during loading page wp.pl. but it doesn't work at all. I'm a bit confused. What's wrong?
Hallvord R. M. Steenhallvors # Wednesday, April 20, 2005 10:34:02 AM
Robert Błautquiris # Wednesday, April 20, 2005 10:34:02 AM
// ==UserScript==
// @include http://www.7thguard.net*
// @include http://7thguard.net*
// ==/UserScript==
alert('bla');
for http://7thguard.net works.
for http://www.7thguard.net doesn't work.
The problem is described in the thread: http://my.opera.com/forums/showthread.php?s=&threadid=87827
And I've got one more question concerning the thread: http://my.opera.com/forums/showthread.php?s=&threadid=88943 Why the entry: Always Load User JavaScript=1 doesn't work?
scipio # Wednesday, April 20, 2005 10:34:02 AM
I have written the following script that should work for a number of sites:
// ==UserScript==
// @include http://www.leidschdagblad.nl/*
// @include http://www.limburgsdagblad.nl/*
// @include http://www.telegraafholding.nl/*
// @include http://www.hdcmedia.nl/*
// @include http://www.limburgadverteren.nl/*
// @include http://www.nhd.nl/*
// @include http://www.gooieneemlander.nl/*
// @include http://www.haarlemsdagblad.nl/*
// @include http://www.ijmuidercourant.nl/*
// @include http://www.dvhn.nl/*
// @include http://www.vakantierecreatie.nl/*
// @include http://www.almerevandaag.nl/*
// ==/UserScript==
window.opera.defineMagicVariable(
'bSupportedBrowser',
function(){return true;},
null
);
When I try it, it doesn't work. If I remove all @include lines except the first, I can open <http://www.leidschdagblad.nl> without any problems. Am I doing something wrong?