Tuesday, August 2, 2011 9:19:38 PM
JavaScript does not have access to Windows clipboard
in Opera. This code allows to copy document's title to clipboard with a
combination of Opera commands and JavaScript.
This code allows to copy the title of the web page and replace special characters (?:|):
Ctrl B=Go to page, "javascript:document.write(document.title)" & Delay,50 & Select all & Copy & Back
This code allows to copy the title of the web page and replace special characters (?:|):
GestureDown, GestureLeft, GestureRight=Go to page, "javascript:{var t=document.title;document.write(t.replace(/\?/g,'¿').replace(/:/g,'-').replace(/\x22/g,'\'').replace(/\|/g,'•').replace(/\\/g,'_').replace(/\//g,'_'))}" & Delay,50 & Select all & Copy & Back
BUTTON: Copy web page title to clipboard
This code allows to copy text selection and replace special characters (?:|):
Ctrl B=Go to page, "javascript:{var sel=window.getSelection();document.write(sel.toString().replace(/\?/g,'_').replace(/:/g,'-').replace(/\x22/g,'\'').replace(/\|/g,'-').replace(/\\/g,'_').replace(/\//g,'_'))}" & Delay,50 & Select all & Copy & Back
This code allows to copy the webpage title + text selection and replace special characters (?:|):
Ctrl G=Go to page, "javascript:{var sel=window.getSelection();document.write(document.title.replace(/\?/g,'_').replace(/:/g,'-').replace(/\x22/g,'\'').replace(/\|/g,'-').replace(/\\/g,'_').replace(/\//g,'_') + ' ; ' + sel.toString().replace(/\?/g,'_').replace(/:/g,'-').replace(/\x22/g,'\'').replace(/\|/g,'-').replace(/\\/g,'_').replace(/\//g,'_'))}" & Delay,50 & Select all & Copy & Back
This code allows to copy text selection or the webpage title (if no text is selected) and replace special characters (?:|):
Ctrl G=Go to page, "javascript:{var t=document.title; var sel=window.getSelection();sel=sel.toString();};if(sel.length !=0){document.write(sel.replace(/\?/g,'_').replace(/:/g,' - ').replace(/\x22/g,'\'').replace(/\|/g,'•').replace(/\\/g,'_').replace(/\//g,'_'))}else{document.write(t.replace(/\?/g,'_').replace(/:/g,'-').replace(/\x22/g,'\'').replace(/\|/g,'-').replace(/\\/g,'_').replace(/\//g,'_'))}" & Delay,50 & Select all & Copy & Back
Or by using a User JavaScript called with this shortcut:
Ctrl G=Enable javascript & Delay, 10 & Go to page,"javascript:Save_title_Selection()" & Delay, 5 & Copy & Click default button
Save_title_Selection=function(){ var title=document.title; var sel=window.getSelection().toString(); var out = (sel.length !=0) ? sel : title; out=out.toString().replace(/\?/g,'¿').replace(/:/g,' - ').replace(/\x22/g,'\'').replace(/\|/g,'•').replace(/\\/g,'-').replace(/\//g,'-').replace(/(\r\n|\n|\r)/gm,' '); window.prompt('',out); }
No comments:
Post a Comment