Skip navigation.

Search & Thumbnails in opera:cache for Opera Mobile

,

As you know thumbnails can be added in "opera:cache" for Desktop Opera v9.xx.
If you do not know this, please see "Thumbnails in opera cache"(http://my.opera.com/Lex1/blog/show.dml/1014525).

By the knowledge of this, I added thumbnails for Opera Mobile v8.65.

Replace in yours *.lng file, string «21418="Size"» on
21418="Size<script type='text/javascript' src='file://localhost//Application Data/Opera/thumbnails-in-opera-cache.js'></script>"

In this case Opera profile folder is "\Application Data\Opera\".

"thumbnails-in-opera-cache.js" file contains following text strings.
document.addEventListener('load',function() {for(var i=0; document.links[i]; i++){document.links[i].target = '_blank'};var l = document.getElementsByTagName('tr');var sf=document.createElement('input'); sf.type = 'text';sf.defaultValue='Search';sf.style='margin:0 4px;float:right;'; sf.addEventListener('focus',function(){if(this.value==this.defaultValue){this.value='';}},false);sf.addEventListener('blur',function(){if(!this.value){this.value=this.defaultValue;}},false);sf.addEventListener('keyup',function(){var v=this.value;for(var i=1, li; li=l[i]; i++){var p=li.lastChild.firstChild.innerText;if(p && p.indexOf(v)==-1){li.style='display: none'} else{li.style='display: table-row'}; }},false); var inp=document.createElement('input'); inp.type='button'; inp.value='Thumbnails';inp.style='float:right;';inp.addEventListener('click', function(){var b=/\.(jpe?g|bmp|gif|png|ico|swf|flv)$/i;var f=/\.(swf|flv)$/i;for(var i=1, li; li=l[i]; i++){var p=li.lastChild.firstChild;var c=li.lastChild.firstChild.innerText;if(li.offsetHeight!=0 && p.childNodes.length<2){if(b.test(c)){var stl='float:right; border:1px dotted black; margin:1px; padding:1px;'; if(f.test(c)){var dv=document.createElement('div');p.appendChild(dv);dv.innerHTML='<EMBED src='+p.href+'>';var fh=dv.firstChild;fh.setAttribute('height', 100);fh.setAttribute('width', 100);fh.setAttribute('style', stl+' content:normal; outline:none; color:inherit;');} else {var image=document.createElement('img');image.setAttribute('src',p.href);if(!image.height || image.height>100){image.height='100'};if(!image.width || image.width>100){image.width='100'};image.setAttribute('style', stl);p.appendChild(image);}}}};}, false);var td=document.getElementsByTagName('td')[2];td.appendChild(inp);td.appendChild(sf); },false)


If you enter opera:cache into the address field you can get on your screen

and by clicking [Thumbnails] button

and by entering a search word (in this case "png" was entered)


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.

"Disable/Enable external CSS" bookmarklet

This bookmarklet toggle the status of the usage about external CSS.
If you invoke this bookmarklet for the first time on some web page, CSS will be disabled.
So, you will (probably) see simple view of the page.
And if you invoke this bookmarklet for the second time, CSS will be enabled.
At this time you can see the same view of the page with which you saw at first time you opened the page.

javascript:(function(){var L=document.getElementsByTagName("link");for(var i=0;i<L.length;i++){if(L[i].rel.toLowerCase()=="stylesheet"){if(L[i].disabled==false){L[i].disabled=true;}else if(L[i].disabled==true){L[i].disabled=false;}}}})();


For more detailed descriptions please see the following page.(Sorry, Japanese only)
http://d.hatena.ne.jp/borbis/20050915

"iFrame/Frame to link list" bookmarklets

These bookmarklets make lists of iFrames/Frames in current page.
By clicking the link you can see the iFrame/Frame on a whole window.
This function is useful for narrow and small screen devices.

1. iFrame/Frame to link list
javascript:(function(){var d=document,f,g,n=0,s="",t=["frame","iframe"],u;for(u in t)for(f=d.getElementsByTagName(t[u]),g=0;g<f.length;g++,n++)s+="<a href=\""+f[g].src+"\">"+n+"."+t[u]+"="+f[g].name+"</a><BR>";n?d.write(s):alert("NoIFrame!")})()

2. Frame to link list
javascript:(function(){if(top.length<1){alert("NoFrame!")}else{var i,s=""; for(i=0;i<top.length;i++){s+="<a href="+frames[i].location.href+">"+i+"."+frames[i].document.title+"</a><BR>";}; document.write (s);}})();


For more detailed descriptions please see following pages.(Sorry, Japanese only)
http://d.hatena.ne.jp/borbis/20040514/p4
http://d.hatena.ne.jp/borbis/20040514/p5

"Reload every" bookmarklets

These bookmarklets are similar to Opera browser's "Reload every" function.

1. For "Opera 8.5 for Windows Mobile".
javascript:(function(){var T=prompt('Reload every(seconds)','60');if(T&&!isNaN(T)){var F='<html><frameset rows="*,0"><frame src="'+location+'"><frame></frameset></html>';var W=open();with(W.document){write(F);close();}var H='<html><script>function R(){parent.frames[0].location="'+location+'";}setInterval("R()",'+T*1000+');</script></html>';with(W.frames[1].document){write(H);close();}}})();


2. For "Opera 7.0 AH-K3001V(Kyocera)"
javascript:(function(){var T=prompt('R-time?','60');if(T&&!isNaN(T)){location='file://localhost/C:/data/areload.html?'+T;}})();

where, contents of the local file "C:/data/areload.html" are
<html>
<script>
document.write('<frameset>');
document.write('<frame name="areload" src="'+document.referrer+'">');
document.write('</frameset>');
setTimeout('R()',location.search.substring(1)*1000);
function R(){location.reload();}
</script>
</html>

.

For more detailed descriptions please see the following pages.(Sorry, Japanese only)
http://d.hatena.ne.jp/borbis/20060122
http://d.hatena.ne.jp/borbis/20040514/p1

助けて! Help me!

こんな異国のブログに日本語で書いても誰も読まないだろうとは、思いつつ。。。

教えて君で申し訳ありませんが、
my.opera.comに↓のようなファイルをアップロードしたところ
http://my.opera.com/borbis/homes/files/○×△.html

my.opera.comの仕様が変更されたのか?何故か? JavaScript部分が書き換わってしまいます。

具体的には、
アップロード元の内容:<script language="JavaScript">
アップロード先の内容:<notallowed language="noscript">

おそらくmy.opera.com側で書き換えているのだと思いますが、
アップロード元のファイルの内容を、そのまま、my.opera.comに登録する方法が判りません。

どなたか、Help me!