You need to be logged in to post in the forums. If you do not have an account, please sign up first.
Make a bookmarklet...? :/ This article shows how to effectively load jQuery with a bookmarklet... Instead of jQuery you can load your script...
OR
Make a function out of your JS, put it into a UserJS and then use a bookmarklet to activate your function...
OR
Make a function out of your JS, put it into a UserJS and then use a bookmarklet to activate your function...
http://my.opera.com/community/forums/findpost.pl?id=2883796
Open new page. Insert javascript:alert(navigator.userAgent) to address bar. Press Enter. Drag it on any panel (with Shift).
2010-06-06 02 13 03.png
a simple procedure?
Open new page. Insert javascript:alert(navigator.userAgent) to address bar. Press Enter. Drag it on any panel (with Shift).
2010-06-06 02 13 03.png
8. June 2010, 14:05:05 (edited)
Originally posted by dertbox:
Make another folder for the website you don't want to run the script on and put all but the scripts you don't want into it, then set that as the userjs folder in the site preferences.
there are numerous websites I want to run the script and numerous I don't want to run it, so doing this on per website basis is very time consuming
Opera 11 on WinXP Pro SP3 • AMD hexacore 3.2Ghz with 4Gb RAM
I want to run the script
// script
window.addEventListener('message', function(e){
if(e.data == 'prefix'+'_run'){
runScript();
// frame support
var postMsg = function(msg){for(var i = 0, f = window.frames, l = f.length; i < l; i++)f[i].postMessage(msg)};
postMsg('prefix'+'_run');
};
}, false);
// button
Go to page, "javascript:window.postMessage('prefix'+'_run')"
Originally posted by Lex1:
I want to run the script
// script window.addEventListener('message', function(e){ if(e.data == 'prefix'+'_run'){ runScript(); // frame support var postMsg = function(msg){for(var i = 0, f = window.frames, l = f.length; i < l; i++)f.postMessage(msg)};
postMsg('prefix'+'_run');
};
}, false);// button Go to page, "javascript:window.postMessage('prefix'+'_run')"
Lex1 thanks but where do I put the code of the JS I want to run ??
Opera 11 on WinXP Pro SP3 • AMD hexacore 3.2Ghz with 4Gb RAM
For compatibility with latest build:
// script
window.addEventListener('message', function(e){
if(e.data == 'prefix'+'_run'){
runScript();
// frame support
var postMsg = function(msg){for(var i = 0, f = window.frames, l = f.length; i < l; i++)f[i].postMessage(msg, '*')};
postMsg('prefix'+'_run');
};
}, false);
// button
Go to page, "javascript:window.postMessage('prefix'+'_run', '*')"
Originally posted by Lex1:
For compatibility with latest build:
Thank you! Thank you! Thank you!
You saved my day!
Looking for a new home for your blog, albums, mail and forums after my.opera closes at march 1, 2014?
Visit https://vivaldi.net - the new community set up by Jon S. v. Tetzchner and several former Opera employees. Many of us are already there and some of the employees too
Visit https://vivaldi.net - the new community set up by Jon S. v. Tetzchner and several former Opera employees. Many of us are already there and some of the employees too
Edit YOUR_BUTTON_TITLE to the title and YOUR_SKIN_IMAGE to the icon name you want to use for your button. Replace spaces in title and name with %20
Example with the code above: YOUR BUTTON TITLE
or
paste the code into the adressbar and press the "Enter" key. You'll see an error page with an url in it, click on it and proceed as in Step 3 above above.
For the Javascript:
Copy the code that Lex1 posted and replace runScript(); with your code.
Example:
opera:/button/Go%20to%20page%2C%20%22javascript%3Awindow.postMessage('prefix'%2B'_run'%2C'*')%3B%22%2C%2C%22YOUR_BUTTON_TITLE%22%2C%22YOUR_SKIN_IMAGE%22
- Save it as HREF in an A tag on a webpage or in the URL Tag here in the forums or your blog
- Click on it
- Click "OK"
- Drag it to the toolbar you want
Example with the code above: YOUR BUTTON TITLE
or
paste the code into the adressbar and press the "Enter" key. You'll see an error page with an url in it, click on it and proceed as in Step 3 above above.
For the Javascript:
Copy the code that Lex1 posted and replace runScript(); with your code.
Example:
// script
window.addEventListener('message', function(e){
if(e.data == 'prefix'+'_run'){
// Paste your working script code below ********
function(){
alert('It works!');
}
// End of your code ***********
// frame support
var postMsg = function(msg){for(var i = 0, f = window.frames, l = f.length; i < l; i++)f[i].postMessage(msg, '*')};
postMsg('prefix'+'_run');
};
}, false);
Looking for a new home for your blog, albums, mail and forums after my.opera closes at march 1, 2014?
Visit https://vivaldi.net - the new community set up by Jon S. v. Tetzchner and several former Opera employees. Many of us are already there and some of the employees too
Visit https://vivaldi.net - the new community set up by Jon S. v. Tetzchner and several former Opera employees. Many of us are already there and some of the employees too