Skip navigation.

Posts tagged with "Bookmarklet-like"

Bookmarklet-like scripting for Opera Mobile Ver8.65BETA or later.

As you know, so-called "Bookmarklet" does not work in Opera Mobile after the version 8.65 BETA. However, "data: URI scheme" is still left for us. There is a decisive difference between "Bookmarklet" and javascript within "data: URI scheme". Javascript in a "Bookmarklet" can be executed as same-site, but javascript within "data: URI scheme" must content itself with cross-site scripting security restrictions. But I think the javascript within "data: URI scheme" is still valuable.
On the other hand, we obtained "Web search in address bar" in this new Opera Mobile. I noticed that I could realize a function similar in "Bookmarklet" by putting "data: URI scheme" and "Web search in address bar" together. The reason is because "data: URI scheme" can change processing at run time by a %s parameter.
As you know, Desktop Opera also have "Web search in address bar" feature. Furthermore, we can add a new search by going to Tools > Preferences > Search.
I copied my search.ini file from Desktop Opera 9.22 to Opera Mobile 8.65BETA. I could search on my Opera Mobile just like on my Desktop Opera. But I am not sure about the compatibility of search.ini file. So, copying search.ini is AT YOUR OWN RISK.

Reload Every bookmarklet-like script

In order to add the "Reload Every" script as a new "search engine", go to Tools > Preferences > Search > Add > Details ,and fill in the text field like below. Name (of Search engine)
Reload Every
Keyword (of Search engine)
reload
Address (of Search engine)
data:text/html;charset=utf-8,<html><body><script>var U='%s';var T;if((U=prompt('URL OK?',U))&&(T=prompt('Reload every(seconds)?','60'))&&!isNaN(T)){location='data:text/html;charset=utf-8,<html><frameset rows=*,0><frame src='+U+'><frame src="data:text/html;charset=utf-8,<html><script>function R(){parent.frames[0].location='+String.fromCharCode(39)+U+String.fromCharCode(39)+'}setInterval('+String.fromCharCode(39)+'R()'+String.fromCharCode(39)+','+T*1000+');</scr'+'ipt></html>'+'"></frameset></html>'}</script></body></html>
Usage of this "Reload Every" script. There are two ways of executing the "Reload Every" script, one way is executing as a new "search engine" as described above, another way is not a search engine but a ordinary bookmark. 1. Using as a new "search engine".   Type the keyword "reload" into the address field, and the URL of the page you want to reload.   For example type   reload http://www.opera.com/   to reload Opera's home page. 2. Using as a ordinary bookmark.   Bookmark the address of the "search engine" described above.   And run it just like a bookmarklet.   And type in the URL of the page you want to reload in replace to %s. If you wish to execute the "Reload Every" script experimentally, copy'n'paste the address of the "search engine" described above into the address bar and press [Enter] key.

Site Check bookmarklet-like script

The script checks a given web page through the following web services. In order to add the "Site Check" script as a new "search engine", go to Tools > Preferences > Search > Add > Details ,and fill in the text field like below. Name (of Search engine)
Site Check Mobile
Keyword (of Search engine)
sitecm
Address (of Search engine)
data:text/html;charset=utf-8,<html><title>SiteC</title><body><script>var U='%s',C=encodeURIComponent,H='http://',agU=H+'www.aguse.net/?m=w&url='+C(U),drU=H+'online.drweb.com/result?url='+C(U),siU=H+'www.siteadvisor.com/lookup/?q='+U.split('/')[2],gsU=H+'g.s.scandoo.com/search?meta=on&q='+C(U.replace(/^https?:\/\//,'')),soU=H+'so.7walker.net/index.php?site='+C(U)+'&hua=&phishing=on';function F(L){return '<A HREF='+L+' target=_blank>'+L+'</A><BR><BR>'}document.body.innerHTML='<html><body>Check URL<BR>'+F(U)+'<HR>'+F(agU)+F(drU)+F(siU)+F(gsU)+F(soU)+'</body></html>'</script></body></html>
Usage of this "Site Check Mobile" script. You can use it as a new search engine.
  • Type the keyword "sitecm" into the address field, and the URL of the page you want to check.
  • For example type   sitecm http://www.opera.com/   to check Opera's home page.
If you type the following "search words" into the address field
sitecm http://www.opera.com/
the script generate the following "URL strings" and you will get several links on your screen to the web services described above.
data:text/html;charset=utf-8,<html><title>SiteC</title><body><script>var U='http://www.opera.com/',C=encodeURIComponent,H='http://',agU=H+'www.aguse.net/?m=w&url='+C(U),drU=H+'online.drweb.com/result?url='+C(U),siU=H+'www.siteadvisor.com/lookup/?q='+U.split('/')[2],gsU=H+'g.s.scandoo.com/search?meta=on&q='+C(U.replace(/^https?:\/\//,'')),soU=H+'so.7walker.net/index.php?site='+C(U)+'&hua=&phishing=on';function F(L){return '<A HREF='+L+' target=_blank>'+L+'</A><BR><BR>'}document.body.innerHTML='<html><body>Check URL<BR>'+F(U)+'<HR>'+F(agU)+F(drU)+F(siU)+F(gsU)+F(soU)+'</body></html>'</script></body></html>
If you want to simulate the script before installing the "search engine", you have only to copy&paste&go this "URL strings" into the address field. Then you shall see on your screen like below.

Check URL http://www.opera.com/


http://www.aguse.net/?m=w&url=http%3A%2F%2Fwww.opera.com%2F
http://online.drweb.com/result?url=http%3A%2F%2Fwww.opera.com%2F
http://www.siteadvisor.com/lookup/?q=www.opera.com
http://g.s.scandoo.com/search?meta=on&q=www.opera.com%2F
http://so.7walker.net/index.php?site=http%3A%2F%2Fwww.opera.com%2F&hua=&phishing=on


Supplemental Remarks

Those users who have knowledge about searach.ini would directly edit there own search.ini. Attempting the convenience of people who want to customize the search.ini file from now on, I edited the original search.ini file which was attached to Opera Mobile 8.65 beta for Windows Mobile PPC. I uploaded the original search.ini file to here, where, the filename is renamed to search.ini.Original.ini. And I uploaded a newly edited search.ini file to here, where, the file is named as search.ini.865b+dataURI.ini. The difference between search.ini.Original.ini and search.ini.865b+dataURI.ini is
  • [Search Engine 1] is change to Google Search. For example, g SEARCH-WORDS.
  • [Search Engine 5] for Yahoo Search is changed a little, For example, y SEARCH-WORDS.
  • Search Engines with number from 7 to 12 are added.
You can get some more scripts at here,which is written in Japanese.