Skip navigation.

小楼夜听雨

Opera 自娱自乐  之后

STICKY POST

Opera 自娱自乐   之后

  说明:原先的blog: http://my.opera.com/cj8631/blog/  将那里的一些文章转移过来,顺便做了部分的更新修正。

  为什么要使用Opera?因为它是世界上最快的浏览器。 
  而且更大的乐趣在于:自己可以动手编辑ini等配置文件,打造符合自己习惯的浏览器,近于随心所欲。而在这过程中,并不需要使用者有多少电脑水平,只要有一些耐心和细心就足够了。


  Opera,世界上最快的浏览器。
  Opera的速度优势,源自于独特的内核Presto。而且Opera完善的网页浏览功能,如标签浏览、鼠标手势、广告过滤、右键菜单、界面皮肤、搜索引擎等,可以让使用者几乎随心所欲地定制,从而符合各自的浏览习惯。
  同时,Opera是一个小巧而功能强大的跨平台互联网套件。除了网页浏览,还有下载管理、邮件客户端、RSS阅读器、IRC聊天、新闻组阅读、快速笔记、幻灯显示(Operashow)等功能。Opera拥有一流的安全性,完美支持包括SSL 2/3以及TLS在内的各种安全协议,支持256位加密,可以抵御恶意代码攻击、钓鱼攻击等网络攻击。
  自Opera9 TP/Beta开始,浏览速度有了进一步的提升,还添加了一些新功能:bt下载;网页元素过滤器,只需点几下鼠标即可过滤不想要的内容;更加方便的搜索引擎管理,在搜索框中按鼠标右键直接创建新搜索;以及新颖的widgets 等。来自挪威的Opera,在不断创新的同时,始终保持自己别具一格的特色。
Opera,让你真正体验到上网冲浪的乐趣。



一、安装

在安装时,建议不要选择勾选“为每个用户单独设置”,也不要装在系统盘里。
如果您选择勾选,您的个人设置将保存在:
C:\Documents and Settings\用户名\Application Data\Opera\Opera\profile。
如果不勾选、也不装在系统盘里,这样Opera的设置文件就保存在安装文件夹Opera\profile里,在系统重装或ghost后,Opera也可以照常使用,相关设置不会丢失。
1、经典的Windows Classic版本安装示意图

2、Opera 9.0的Windows MSI版本安装示意图



二、网页正常浏览显示的设置

1、语言选择:在菜单栏依次点击:Tools(工具)>Preferences(首选项)>General(常规)>Language(语言)>Details(详细信息)>User Interface Language(用户界面语言)>Choose(选择),选择相关语言文件。

2、标签浏览:首选项>高级>标签,不勾选“重用当前标签”。

3、编码:首选项>常规>详细信息>对没有指定编码的网页应用的编码,设置为gbk。

4、文字大小:首选项>高级>字体,将最小字体像素设置为12。


三、取消Opera9.0自带的BT下载
在“首选项>高级>下载”中取消“隐藏用Opera打开的文件类型”,然后查找“torrent”一项,编辑选择为“显示下载对话框”。


四、超级拖拽
在Opera6.ini文件的[User Prefs]区段下增加
Enable Drag=255



五、更改文件路径
更改Opera 临时文件(缓存)的路径,用记事本打开opera6.ini在[User Prefs]下添加:
Cache Directory4=你所希望保存的路径
例如:
Cache Directory4=E:\Temp


更改Mail的路径:在 opera6.ini的[Mail]下修改:Mail Root Directory=你所希望保存的路径
更改profile的路径:在 opera6.ini的[User Prefs]下修改:Opera Directory=你所希望保存的路径
更改笔记的路径:在opera6.ini 添加[MailBox],并指定:NotesFile=你所希望保存的路径
注:修改前先将mail/profile等需要改变路径的文件夹移至新路径中。

六、Opera浏览不留痕
Opera的设置里是没有自动清除已访问过的链接选项的,除非使用工具->删除私人数据,否则我们访问过的链接记录就会留下来。当别人在同一台电脑上使用Opera的时候就会看到我们先前访问过的链接是打开过的颜色,这无疑会暴露我们的行踪。

不让Opera记录我们访问过的链接:
先将隐藏文件显示出来,然后找到profile目录。找到里面名为vlink4(可能会存在几个后缀名不同的vlink4,如vlink4.old)的文件,将其属性改为“只读”并去掉“存档”前面的勾。以后当我们关掉Opera再打开的时候,我们访问过的链接就会和没访问过的链接颜色一样。

注意:每次更改属性时都要关掉Opera浏览器。第一次更改vlink4.dat后,Opera可能会再创建vlink4.old和vlink4.new这两个文件,把这两个文件的属性也改一下就可以了。


七、修改标签宽度
1、找到正在使用skin文件夹中的Skin皮肤,用压缩软件双击,打开文件夹目录。
2、在文件夹目录中,找到“skin.ini”并双击打开,找到[Options]段,修改添加具体如下:
Pagebar max button width = 自定义标签最大宽度
Pagebar min button width = 自定义标签最小宽度

如果没有就添加上面的两段。单位为像素,自己设置为“120,25”。注意,等号后要有一个半角空格,再接数字。
3、将修改后的文件保存,重启Opera。
注:皮肤文件不是解压后修改,似乎自定义标签最小宽度无效。

八、更改opera9.0的标题
opera:config中或者在opera6.ini里搜索Title后修改。
opera:config
点击更改opera9.0标题Title
Title=你想要的标题
例:
Title=Opera %v %s        %t

%t为网页标题。%v %s为版本号及build版本号。空键调整距离。%v %s %t可以任意位置。或者输入其他任意内容。



Opera 简体中文维基
Opera 皮肤

Opera用user.css过滤新浪网广告的方法

来自官方社区,广告过滤后非常清爽
将以下内容添加到user.css中,或者新建一个user.css保存。然后在首选项-内容-样式选项中指定“我的样式选项”。
td[width="360"][class="rc_trans"][bgcolor="#F0EFEF"]
{display:none !important;}

mark_poleon关于Opera的定制技巧

觉得很实用,收集到一起。原作者:mark_poleon
一、定制对话框,打开详细状态。
原文链接
注:Opera 9 for Windows (Opera 9 TP2 Up)
找到 Opera\dialog.ini 用下面的代码替换原内容,修改后下列对话框默认为详细状态

1、添加书签
[Add Bookmark Dialog]
Title = 70495
Group0, 67000, , 10, 10, 330, 323, Center, End
Label1, 25103, Name_label, 0, 0, 90, 23, Fixed
Edit2, 0, Name_edit, 100, 0, 270, 23, Size right
Label13, 70496, Parent_label, 0, 30, 90, 23, Move down
Dropdown, , Parent_dropdown, 100, 30, 270, 23, Size right Move down
Button, 70497, New_folder_button,100,60,130,23,Move down = New folder
;Button,,, 240, 60, 130, 23, Move right= Set visibility, "Advanced_group", 0, 70744 | Set visibility, "Advanced_group", 1, 70743
;Group, 0, Advanced_group , 0, 90, 370, 180, Size right, End
Group, 0, , 0, 90, 370, 180, Size right, End
Label5, 10944, URL_label, 0, 0, 90, 23, Fixed
Edit6, 0, URL_edit, 100, 0, 270, 23, Size right
Label3, 10943, Nick_label, 0, 30, 90, 23, Fixed
Edit4, 0, Nick_edit, 100, 30, 270, 23, Size right
Label7, 10945, Description_label, 0, 60, 90, 23, Fixed
MultilineEdit8, 0, Description_edit, 100, 60, 270, 53, Size
Checkbox15, 54023, ShowOnPersonalbar_check, 100, 120, 270, 23, Move down
Checkbox16, 70498, ViewInPanel_check, 100, 150, 270, 23, Move down, End


2、删除私人数据
[Clear Private Data Dialog]
Title = 19011
Group, 0, , 0, 0, 0, 0, Size, End
MultilineEdit, 70489, Description_label, 0, 0, 280, 50, Size right
;Button,,, 300, 0, 130, 23, Move right = Set visibility, "Advanced_group", 0, 70744 | Set visibility, "Advanced_group", 1, 70743
;Group, 0, Advanced_group , 0, 50, 430, 360, Size right, End
Group, 0, , 0, 50, 430, 360, Size right, End
Checkbox, 25156, Delete_temporary_cookies, 0, 0, 300, 23, Size right
Checkbox, 25159, Delete_all_cookies, 0, 30, 250, 23, Size right
Button, 68042,, 250, 30, 180, 23, Move right = Manage cookies
Checkbox, 25157, Delete_passworddocs_and_data, 0, 60, 300, 23, Size right
Checkbox, 25164, Clear_cache, 0, 90, 300, 23, Size right
Checkbox, 25160, Clear_visited_pages, 0, 120, 300, 23, Size right
Checkbox, 25161, Clear_typedin_addresses, 0, 150, 300, 23, Size right
Checkbox, 25163, Clear_visited_links, 0, 180, 300, 23, Size right
Checkbox, 25165, Clear_transferred_files_history, 0, 210, 300, 23, Size right
Checkbox, 68044, Clear_bookmark_visited_time, 0, 240, 300, 23, Size right
Checkbox, 25162, Clear_email_account_passwords, 0, 270, 300, 23, Size right
Checkbox, 25169, Clear_wand_passwords, 0, 300, 250, 23, Size right
Button, 68043,, 250, 300, 180, 23, Move right = Manage wand
Checkbox, 70446, Close_all_windows, 0, 330, 300, 23, Size right, End



3、创建搜索 (右键)
[Search Engine Dialog]
Title = 819599123
Group, 0, 0, 0, 0, 450, 400, Size right
Label, 359962014, , 0, 0, 80, 23, Fixed
Edit, , Search_engine_name, 80, 0, 370, 23, Size right
Label, 17061, , 0, 30, 50, 23, Fixed
Edit, , Search_engine_key, 80, 30, 50, 23, Fixed
Label, "", Search_engine_status, 135, 30, 170, 23, Size right
;Button,,, 310, 30, 140, 23, Move right = Set visibility, "Advanced_group", 0, 70744 | Set visibility, "Advanced_group", 1, 70743
;Group, 0, Advanced_group , 0, 60, 450, 90, Size right, End
Group, 0, , 0, 60, 450, 90, Size right, End
Label, 10944, , 0, 0, 80, 23, Fixed
Edit, , Search_engine_url, 80, 0, 370, 23, Size right
Label, -458107340, , 0, 30, 80, 23, Fixed
Edit, , Search_engine_query, 80, 30, 270, 23, Size right
Checkbox, -1853882022, Search_engine_use_post, 360, 30, 90, 23, Move right
Checkbox, 217241825, Default_search_checkbox, 80, 60, 370, 23, Size right, End



二、添加 "Menu bar(菜单栏)" 到你的工具栏对话框
原文链接
你可以控制 隐藏/显示 菜单栏在 工具 > 外观 > 工具栏
打开 dialog.ini (opera/dialog.ini),
找到 [Customize Toolbar Dialog] 这个部分
380 行你将看到下面的代码
Checkbox, 145550, , 10, 30, 160, 23, Fixed = Set alignment, "browser toolbar", 6 | Set alignment, "browser toolbar", 0
Checkbox, 170510, , 10, 55, 160, 23, Fixed = Set alignment, "personalbar", 6 | Set alignment, "personalbar", 0
Checkbox, 170210, , 10, 80, 160, 23, Fixed = Set alignment, "pagebar", 6 | Set alignment, "pagebar", 0
Checkbox, 145570, , 170, 30, 160, 23, Fixed = Set alignment, "status toolbar", 6 | Set alignment, "status toolbar", 0
Checkbox, 150740, , 170, 55, 160, 23, Fixed = Set alignment, "document toolbar", 6 | Set alignment, "document toolbar", 0
Checkbox, 70442, , 170, 80, 160, 23, Fixed = Set alignment, "start toolbar", 6 | Set alignment, "start toolbar", 0
Checkbox, 70443, , 330, 30, 160, 23, Fixed = Set alignment, "document view toolbar", 6 | Set alignment, "document view toolbar", 0
Checkbox, 67400, , 330, 55, 160, 23, Fixed = Set alignment, "site navigation toolbar", 6 | Set alignment, "site navigation toolbar", 0


用下面的代码替换上面的代码,“Menu bar” 可以改成“菜单栏”,需要保存为 UTF-8 编码。
Checkbox, "Menu bar", , 10, 30, 160, 23, Fixed = Enable menu bar | Disable menu bar
Checkbox, 145550, , 10, 55, 160, 23, Fixed = Set alignment, "browser toolbar", 6 | Set alignment, "browser toolbar", 0
Checkbox, 170510, , 10, 80, 160, 23, Fixed = Set alignment, "personalbar", 6 | Set alignment, "personalbar", 0
Checkbox, 170210, , 170, 30, 160, 23, Fixed = Set alignment, "pagebar", 6 | Set alignment, "pagebar", 0
Checkbox, 145570, , 170, 55, 160, 23, Fixed = Set alignment, "status toolbar", 6 | Set alignment, "status toolbar", 0
Checkbox, 150740, , 170, 80, 160, 23, Fixed = Set alignment, "document toolbar", 6 | Set alignment, "document toolbar", 0
Checkbox, 70442, , 330, 30, 160, 23, Fixed = Set alignment, "start toolbar", 6 | Set alignment, "start toolbar", 0
Checkbox, 70443, , 330, 55, 160, 23, Fixed = Set alignment, "document view toolbar", 6 | Set alignment, "document view toolbar", 0
Checkbox, 67400, , 330, 80, 160, 23, Fixed = Set alignment, "site navigation toolbar", 6 | Set alignment, "site navigation toolbar", 0

收集的实用js脚本

一、高亮关键词userjs
详细参考

二、动网、94KK 论坛发帖框通用激活器,修复动网BBS发帖
by Opera社区somh
dvbbs-reply-enabler.js

三、修复淘宝网图片显示
taobao-show-images.js
taobao-ww-enabler.js

四、当前页面非链接处鼠标左键双击关闭后转到上次浏览的页面
sjgb.js

五、简繁自动转换
注:暂时只有opera 9以上版本才能运作。如果是不用进行转码时,即正常浏览网页时,是对浏览速度没有影响的
当opera侦测到要进行转码时 e.g繁>简 or 简>繁 ,在网页下载完毕后,大约在少于一秒内会自动完成转码。
1、繁>简
fzj_auto.js

2、简>繁
jzf_auto.js



使用方法:
下载脚本后把它放到某一目录。我一般是在Opera\profile建一文件夹,命名为JS,将一些JS脚本放在其下。然后在Opera设置->内容->JavaScript选项中,自己设定刚才存放脚本的路径,确定。关闭Opera并重新运行使其生效。

Opera 9.10 Final 绿色移动版

Opera 9.10 Final released
版本  9.10
编制  8679

略有定制,解压后先运行opfinder.exe,以更改相应配置。
如果以后需要更改Opera路径,也请移动后首先运行opfinder.exe一次,再运行Opera.exe。
其中所使用的绿色移动工具为somh制作,谢谢!
Opera.rar


另附一份简中语言文件,版本:Opera9.10Build.Win=8670
zh-cn.rar



及somh制作的Opera绿色移动工具:
opfinders绿色移动.7z

Opera精简皮肤(windows自身),修改图标为 16x16px:
windows_skin.zip

Opera9搜索引擎自定义

比较详细的介绍,看这里定制Opera的内置搜索
自Opera9开始,在搜索框内点击右键,可以非常方便地创建新搜索引擎。


附一份简单的搜索引擎文件:
Google
百度
金山词霸
百度Mp3
IP域名位置查询
天空软件
霏凡软件
飞客BT搜索

Opera Preferences version 2.1
; Do not edit this file while Opera is running
; This file is stored in UTF-8 encoding

[Version]
File Version=8

[Search Engine 1]
Name=Google
Verbtext=0
URL=http://www.google.com/search?q=%s&hl=zh-CN&lr=lang_zh-CN&ie=utf-8&oe=utf-8&num=100
Query=
Key=g
Is post=0
Has endseparator=0
Encoding=utf-8
Search Type=0
Position=-1
Nameid=0

[Search Engine 2]
Name=百度
URL=http://www.baidu.com/baidu?tn=baidu&rn=100&word=%s
Query=
Key=b
Is post=0
Has endseparator=-1
Encoding=gbk
Search Type=1
Verbtext=0
Position=-1
Nameid=0

[Search Engine 3]
Name=金山词霸
URL=http://www.iciba.com/search?s=%s
Query=
Key=j
Is post=0
Has endseparator=0
Encoding=iso-8859-1
Search Type=50
Verbtext=0
Position=4
Nameid=-0

[Search Engine 4]
Name=百度Mp3
Verbtext=0
URL=http://mp3.baidu.com/m?f=ms&tn=baidump3&ct=134217728&lf=&rn=&word=%s&lm=0
Query=
Key=bm
Is post=0
Has endseparator=0
Encoding=GBK
Search Type=3
Position=-1
Nameid=0

[Search Engine 5]
Name=IP域名位置查询
URL=http://www.123cha.com/ip/?q=%s
Query=
Key=ip
Is post=0
Encoding=iso-8859-1
Search Type=4
Verbtext=0
Position=-1
Has endseparator=-1
Nameid=-1752296931

[Search Engine 6]
Name=天空软件
Verbtext=0
URL=http://www3.skycn.com/search.php?ss_name=%s&sor=00
Query=
Key=t
Is post=0
Has endseparator=0
Encoding=utf-8
Search Type=6
Nameid=-1752296956
Position=-1

[Search Engine 7]
Name=霏凡软件
URL=http://www.crsky.com/search.asp?keyword=%s&action=soft&action=s&sType=ResName
Query=
Key=f
Is post=0
Has endseparator=0
Encoding=utf-8
Search Type=7
Verbtext=0
Nameid=1632215290
Position=-1

[Search Engine 8]
Name=飞客BT搜索
URL=http://bt.fkee.com/search.aspx?q=%s&p=Seed&b=0
Query=
Key=fk
Is post=0
Has endseparator=0
Encoding=gbk
Search Type=8
Position=-1
Nameid=0
Verbtext=0

[Search Engine 9]
Name=洪恩成语
Verbtext=0
Query=
Key=
Is post=0
Has endseparator=-1
Encoding=UTF-8
Search Type=168
Position=-1
Nameid=0
URL=http://study.hongen.com/dict/ndsearchchengyu.aspx?type=exact&word=%s

Opera9的广告过滤方法

Opera9开始,网页右键有个广告过滤选择,而且按Shift键还能过滤指定内容。
在profile文件夹下自带广告过滤文件urlfilter.ini。开始使用前为空白,可以自己修改,或者省事复制以下内容保存。
此为一比较通用的过滤名单:
Opera Preferences version 2.1
; Do not edit this file while Opera is running
; This file is stored in UTF-8 encoding

[prefs]
prioritize excludelist=1

[include]
*

[exclude]
http://*.keyrun.com*
http://*.114.com.cn/*
http://*.ad.*
http://*.ads8.com/*
http://*.ad/*
http://*.ads.*
http://*.ads/*
http://*.ads8.*
http://*.adsina.*
http://*.banner*
http://*/ad.*
http://*/ad/*
http://*/ad_files/*
http://*/ad_images/*
http://*.allyes.com/*
http://*/ad_js/*
http://*/ad_pic/*
http://*/adclient.*
http://*/adimg/*
http://*/adjs/*
http://*/adpic/*
http://*/ads/*
http://*/a-d-s/*
http://*/adsense/*
http://*.valueclick.com.cn/*
http://spcode.baidu.com/spcode/*
http://usmsad.tom.com/usmsweb/*
http://cpro.baidu.com/*
http://sogou.com/cpc/*
http://b.todayisp.com/*
http://*.googlesyndication.com/*
http://adsence.sogou.com/*
http://*.union.163.com/*
http://*/adspic/*
http://*/adv/*
http://*.taolai.cn/*
http://*/advertising/*
http://*/banner/*
http://*/banners/*
http://*/cert/*
http://*/guanggao/*
http://*/newhuagg/*.gif
http://*/newhuagg/*.jpg
http://*/newhuagg/*.swf
http://*/poster/*
http://*/show_ads.js*
http://*ad*.*JS
http://*ad3.*
http://*ad4.*
http://*ad8.*
http://*ads.*
http://*banner*.*
http://*cpro.baidu*
http://*linkexchange*
http://ad.*
http://ad4.*/*
http://union.3721.com/*


Opera常用按钮

简单的按钮的命令格式基本上是:动作, 参数1, 参数2, 名称, "图标"
忽略的部分用,代替。格式如下:
[opbut=动作, 参数1, 参数2,名称, "图标"]按钮名称[/opbut]

举例说明一下命令格式:
[opbut=Show preferences, , , "首选项", "Prefs Network"]首选项[/opbut]

还有一种格式也可以:
[url=opera:/Button/Show preferences, , , "首选项", "Prefs Network"]首选项[/url]



书签:

button

button 注:没有“添加书签”、“管理书签”两项。

button 注:没有“添加书签”、“管理书签”两项,直接点击打开主页。

button



菜单栏:

button 注:仅仅是菜单栏的隐藏与显示。

button 注:菜单栏的隐藏与显示,带菜单的树状链接。

button 注:菜单的树状链接按钮。

button 注:主工具栏的隐藏与显示按钮,带菜单的树状链接。

button 注:主工具栏、菜单栏的隐藏与显示按钮,带菜单的树状链接。

button 注:调出菜单各项,无下拉小箭头



浏览:

button

button 注:全屏切换,全屏时显示标签栏。

button

button

button

button

button

button

button

button

button

button

button

button

button

button可以翻译网页和选择文字

button

button

button

button

button

button

button



菜单栏上各子项的按钮(无图标)

button

button

button

button

button

button

button

button




button

button

button

button

button

button

button

button

button内框架启用



关于View in IE按钮的写法:
[opbut=Go to page, "javascript:(function () { if( !location.href || location.href.match(/^(javascript|about|opera):/i) ) { return; } var w = window.open(); w.document.write('<html><head><title>' + (document.title?document.title:location.href).replace(/</,'<') + ' - using Internet Explorer rendering<\/title><\/head><body><div style=\'position:absolute;top:0;left:0;right:0;bottom:0;\'><embed type=\'application\/x-meadco-neptune-ax\' width=\'100'+String.fromCharCode(37)+'\' height=\'100'+String.fromCharCode(37)+'\' param-location=\'' + window.location.href + '\'><\/embed><\/div><\/body><\/html>'); })();", , "View in IE", "View"]View in IE[/opbut]



在Opera Blog中写要加变量的:
[opbut=Go%20to%20page%2C%20%22javascript%3A(function%20()%20%7B%20if(%20!location.href%20%7C%7C%20location.href.match(/%5E(javascript%7Cabout%7Copera)%3A/i)%20)%20%7B%20return%3B%20%7D%20var%20w%20%3D%20window.open()%3B%20w.document.write('%3Chtml%3E%3Chead%3E%3Ctitle%3E'%20+%20(document.title%3Fdocument.title%3Alocation.href).replace(/%3C/%2C'%26lt%3B')%20+%20'%20-%20using%20Internet%20Explorer%20rendering%3C%5C/title%3E%3C%5C/head%3E%3Cbody%3E%3Cdiv%20style%3D%5C'position%3Aabsolute%3Btop%3A0%3Bleft%3A0%3Bright%3A0%3Bbottom%3A0%3B%5C'%3E%3Cembed%20type%3D%5C'application%5C/x-meadco-neptune-ax%5C'%20width%3D%5C'100'+String.fromCharCode(37)+'%5C'%20height%3D%5C'100'+String.fromCharCode(37)+'%5C'%20param-location%3D%5C''%20+%20window.location.href%20+%20'%5C'%3E%3C%5C/embed%3E%3C%5C/div%3E%3C%5C/body%3E%3C%5C/html%3E')%3B%20%7D)()%3B%22%2C%2C%22View%20in%20IE%22%2CView]View in IE[/opbut]

高亮关键词userjs的自定义

原贴链接

支持无限多关键词分色高亮,如果多个关键词则以空格间隔。并且支持网页内的框架。完全可以取代内置的查找。可以将关键词保存在cookies中。这对大量查找文献资料的朋友非常有帮助。左上角浮动窗口显示关键词与所有匹配结果。并且可以点击实现“查找下一个”。

方法:
1、将以下内容复制粘贴到记事本,保存为uhb2.5.js文件,放在一个位置,如:\Opera\profile\JS这样的自建文件夹。
// Ultimate Highlight Bookmarklet 2.1
// nontroppo.org/wiki/UHB
//  Guide for scripting:
//   UltimateHighlight();                 -> Prompts for keywords to highlight
//   UltimateHighlightKeywords('keywords'); -> Highlights the 'keywords' string

// Options: 
var p000_UHOption_AutoHighlight= 1, // 1=Automatically highlight pages from google results
    p000_UHOption_AlwaysAsk    = 0, // 1=Always prompt for keywords
    p000_UHOption_ShowFollowUp = 1, // 1=Show results pane when possible
    p000_UHOption_UseCookies   = 1, // 1=Store search terms for each website using cookies
    p000_UHOption_ShowStats    = 0; // 1=Always show result tallies in javascript alert on framed pages

var p000_UHVar_colors=new Array('#ffff66','#A0FFFF','#99ff99','#ff9999','#ff66ff','coral','lime','chartreuse','deepskyblue','fuchsia','gold','indianred','silver','lightsteelblue','olive','orange','lightblue');
var p000_UHVar_gCount,p000_UHVar_gText,p000_UHVar_gKeywords,p000_UHVar_gRE,p000_UHVar_framed;
var p000_UHVar_d1=new Array(),p000_UHVar_d2=new Array(),p000_UHVar_d3=new Array();

// Constructs the results pane
function p000_UHFunc_CreateDiv() {
if(p000_UHOption_ShowFollowUp) {
var divel=document.createElement('div');
var bza='';
var br='<br style=\'display:inline\'/>';
divel.id='divz7rx8v';
divel.style.position='fixed !important';
divel.style.top='0 !important';
divel.style.right='0 !important';
divel.style.margin='0 !important';
divel.style.padding='5px !important';
divel.style.backgroundColor='#f2f2ee';
divel.style.border='2px solid #aaa';
divel.style.zIndex=9000;
divel.style.lineHeight='18px !important';
// "+ _ x" buttons
bza+='<SPAN STYLE=\'padding:5px; margin:0px;\'><a href=\'javascript:UltimateHighlight();UltimateHighlight();\' onmouseover=\'this.style.color=\"#AAA\";this.style.backgroundColor=\"#f2f2ee\";\' onmouseout=\'this.style.color=\"#333\";\' style=\'color:#333; font-family:verdana; text-decoration:none; border:none; font-weight:bold; font-size:12pt; line-height:18px;\'>+</a></SPAN>';
bza+='<SPAN STYLE=\'position:fixed !important; right:10px; top:5px;\'><a href=\'javascript:p000_UHFunc_CloseDiv();\' onmouseover=\'this.style.color=\"#AAA\";this.style.backgroundColor=\"#f2f2ee\";\' onmouseout=\'this.style.color=\"#333\";\' style=\'color:#333; font-family:verdana; text-decoration:none; border:none; font-weight:bold; font-size:12pt; line-height:18px;\'>_</a> ';
bza+='<a href=\'javascript:UltimateHighlight();\' onmouseover=\'this.style.color=\"#AAA\";this.style.backgroundColor=\"#f2f2ee\";\' onmouseout=\'this.style.color=\"#333\";\' style=\'color:#333; font-family:verdana; text-decoration:none; border:none; font-weight:bold; font-size:12pt; line-height:18px;\'>x</a></SPAN>'+br;
// Results
for(var i=0;i<p000_UHVar_d1.length;i++) {
if (p000_UHVar_d2[i]==0){
bza += '<SPAN STYLE=\'padding:5px; color:#000; font-family:verdana; text-decoration:none; border:none; font-size:10pt; line-height:18px;\'>'
+ p000_UHVar_d1[i]+' : '+'not found'+'<span> </span></SPAN>'+br;
} else {
bza += '<SPAN STYLE=\'padding:5px;\'>'
+ '<a href=\'#\' id=\'anch'+p000_UHVar_d1[i].replace(/\ /g,'_')+'\' onclick=p000_UHFunc_Goto(\''+i+'\') onmouseover=\'this.style.color=\"#e22\";this.style.backgroundColor=\"#f2f2ee\";\' onmouseout=\'this.style.color=\"#c00\";\' style=\'color:#c00; font-family:verdana; text-decoration:none; border:none; font-weight:bold; font-size:10pt; line-height:18px;\'>'
+ p000_UHVar_d1[i]+' : '+p000_UHVar_d2[i]+'<span> </span></a></SPAN>'+br;
}
}
divel.innerHTML=bza;
document.body.appendChild(divel);
}
}

// Jumps to the next result
function p000_UHFunc_Goto(here) {
var a = document.getElementById('anch' + p000_UHVar_d1[here].replace(/\ /g,'_'));
a.href = '#g7z' + p000_UHVar_d1[here].replace(/\ /g,'_') + p000_UHVar_d3[here];
a.childNodes[1].firstChild.data = ' / ' + (p000_UHVar_d3[here]+1);

p000_UHVar_d3[here]++;
if(p000_UHVar_d3[here] >= p000_UHVar_d2[here])
p000_UHVar_d3[here] = 0;
}

// Closes the results pane
function p000_UHFunc_CloseDiv() {
var ar;
if(ar=document.getElementById('divz7rx8v')) {
if(window.opera) {
ar.removeNode(true);
} else {
var arL=ar.childNodes.length;
for(var i=0;i<arL;i++) {
ar.removeChild(ar.childNodes[0]);
}
ar.parentNode.removeChild(ar);
}
}
}

// Loads the last saved highlight query used on the current domain
function p000_UHFunc_GetCookie() {
if(p000_UHOption_UseCookies) {
// Don't load cookie for google domain, because we will use the google search query instead
if(document.URL.indexOf('.google.')==-1) {
var search='xz7rx8vUltimateHighlight=';
if(document.cookie.length>0) {
var offset=document.cookie.indexOf(search);
if(offset!=-1) {
offset+=search.length;
var end=document.cookie.indexOf(';',offset);
if(end==-1) {
end=document.cookie.length;
}
p000_UHVar_gText=decodeURIComponent(document.cookie.substring(offset,end));
}
}
}
}
}

// Saves the highlight query in a cookie
function p000_UHFunc_SetCookie() {
if(p000_UHOption_UseCookies) {
document.cookie='xz7rx8vUltimateHighlight='+encodeURIComponent(p000_UHVar_gText)+';path=/;';
}
}

// Constructs the gKeywords, gCount, gRE, gText, d1, d2 and d3 objects
// using the highlight search query "text"
function p000_UHFunc_CheckSearchString(text) {
var x=text;
var i;
var er;
if(text==null) return;
if(text.length==0) return;

// Separate search terms with "|" character
var insidedblquotes=false;
var textpart=text.split('"');
text='';
for (i=0; i<textpart.length; i++) {
if (insidedblquotes) {
text=text+textpart[i].replace(/([\x00-\x19\x28-\x29\x7B-\xBF])+/g,'|').replace(/\+/g,' ');
} else {
text=text+textpart[i].replace(/([\x00-\x20\x28-\x29\x7B-\xBF\+])+/g,'|');
}
insidedblquotes=!insidedblquotes;
}
text='|'+text+'|';
text=text.replace(/\|+/g,'|');
if(text.length<=1) return;
p000_UHVar_gKeywords=null;
p000_UHVar_gRE=null;
p000_UHVar_gText=x;
p000_UHFunc_SetCookie();

// Construct global vars
p000_UHVar_gCount=null;
p000_UHVar_d1.length=0;
p000_UHVar_d2.length=0;
p000_UHVar_d3.length=0;
text=text.substring(1,text.length-1).toLowerCase();
p000_UHVar_gCount=text.split('|');
var len=text.replace(/[^\|]/g, '').length;
p000_UHVar_gKeywords=text.split('|');
for (i=len;i>=0;i--) {
p000_UHVar_d1[i]=p000_UHVar_gKeywords[i];
p000_UHVar_d2[i]=0;
p000_UHVar_d3[i]=0;
p000_UHVar_gKeywords[p000_UHVar_gKeywords[i]]=i;
p000_UHVar_gCount[p000_UHVar_gCount[i]]=0;
}

// Construct regular expression from text query
try {
// Join search terms
var temp='(('+p000_UHVar_d1.join(')|(')+'))';

// Escape special characters inside regexp
temp=temp.replace(/\\/g,'\\\\');
temp=temp.replace(/\-/g,'\\-');
temp=temp.replace(/\*/g,'\\/');
temp=temp.replace(/\$/g,'\\$');
temp=temp.replace(/\^/g,'\\^');
temp=temp.replace(/\./g,'\\.');

// Remove useless "|()" from regexp
temp=temp.replace(/\|\(\)/g,'');

p000_UHVar_gRE=new RegExp(temp,'i');
}
catch(er) {
alert('Unable to make regular expression with: '+text+'.\n\n'+er);
return;
}
return true;
}

// Remove highlights in window w
function p000_UHFunc_ClearWindowHighlights(w) {
var i;
var result=false;
if(p000_UHVar_framed) {
for (i=0;i<w.frames.length;i++) {
result=p000_UHFunc_ClearWindowHighlights(w.frames[i])||result;
}
} else {
result=p000_UHFunc_ClearNodeHighlights(w.document.body);
}
return result;
}

// Removes highlights created by ShowNodeHighlights
function p000_UHFunc_ClearNodeHighlights(node) {
var child,result=false,r;
if(node.nodeType==1) {
if(node.agohighlight) {
// Spannode
result=true;
node.parentNode.replaceChild(node.firstChild,node);
} else if(node.class_gz5rt7vw) {
// Anchor
result=true;
node.parentNode.removeChild(node);
} else if(node.childNodes&&node.tagName.toUpperCase()!='SCRIPT'&&node.tagName.toUpperCase!='STYLE') {
// Child nodes
for (child=node.childNodes.length-1;child>=0;child--) {
r=p000_UHFunc_ClearNodeHighlights(node.childNodes[child]);
result=result||r;
}
}
}
return result;
}

// Highlights all search terms in window w
function p000_UHFunc_ShowWindowHighlights(w) {
var j=0;
if(p000_UHVar_framed) {
for (j=0;j<w.frames.length;j++) {
p000_UHFunc_ShowWindowHighlights(w.frames[j],j);
}
} else {
p000_UHFunc_ShowNodeHighlights(w.document.body,w.document);
}
return true;
}

// Find and highlight search terms in a node
// Returns: the number of nodes that were added by this script
function p000_UHFunc_ShowNodeHighlights(node,mydoc) {
var nkeyw,match,pos=0,skip=0,spannode,middlebit,endbit,middleclone;
if(node.nodeType==3&&node.data) {
tmpdata=node.data.replace(/(\<SELECT.+\<\/SELECT.?\>|\<TEXTAREA.+\<\/TEXTAREA.?\>)/gi,'');
pos=tmpdata.search(p000_UHVar_gRE);
if(pos>=0) {
// Search term found -> Highlight the word(s)
match=RegExp.$1.toLowerCase();
nkeyw=p000_UHVar_gKeywords[match];
p000_UHVar_gCount[match]++;
spannode=mydoc.createElement('SPAN');
spannode.agohighlight=true;
spannode.style.border='dashed black 1px';
spannode.style.fontWeight='bold';
spannode.style.color='black';
spannode.style.backgroundColor=p000_UHVar_colors[nkeyw];
middlebit=node.splitText(pos);
endbit=middlebit.splitText(match.length);
middleclone=middlebit.cloneNode(true);
spannode.appendChild(middleclone);
middlebit.parentNode.replaceChild(spannode,middlebit);
skip=1;
if(p000_UHOption_ShowFollowUp) {
// Create an anchor to jump to this search term
anch=mydoc.createElement('a');
anch.class_gz5rt7vw=true;
anch.id='g7z'+p000_UHVar_d1[nkeyw].replace(/\ /g,'_')+p000_UHVar_d2[nkeyw];
spannode.parentNode.insertBefore(anch,spannode);
p000_UHVar_d2[nkeyw]++;
skip=2;
}
}
} else {
if(node.nodeType==1 && node.childNodes && node.tagName.toUpperCase()!='SCRIPT' && node.tagName.toUpperCase!='STYLE') {
// Visit all child nodes
for (var child=0; child<node.childNodes.length; ++child) {
child = child + p000_UHFunc_ShowNodeHighlights(node.childNodes[child],mydoc);
}
}
}
return skip;  
}

// MAIN highlighting function (Call UltimateHighlight(); with no parameters for normal behavior)
function UltimateHighlight(NoPopup,ReferrerOnly) {
var text,i;
try {
var f=window.top.frames;
}
catch (e) {
var f=window.frames;
}
// Don't show results pane on framed page
if(p000_UHVar_framed=(f.length>document.getElementsByTagName('iframe').length))
p000_UHOption_ShowFollowUp=0;

// If second execution -> Clear results and exit
if(p000_UHFunc_ClearWindowHighlights(window) || document.getElementById('divz7rx8v')) {
p000_UHFunc_CloseDiv();
return;
}

// Reload the last used search query
if(!ReferrerOnly && (p000_UHVar_gText==null))
p000_UHFunc_GetCookie();

// Check if google is the last page in history, and if so, use the search string from it
if(ReferrerOnly||(p000_UHVar_gText==null)) {
if(document.referrer.match(/(^|\.)google\.([^\.]+|[^\.]{2,3}\.[^\.]{2})$/) && document.referrer.indexOf('q=')!=-1) {
var queryTermsRegExp=new RegExp('q=([^&]+)');
if(queryTermsRegExp.test(document.referrer)) {
text=RegExp.$1.replace(/\+/g,' ');
text=decodeURI(text);
}
}
if(location.hostname.match(/(^|\.)google\.([^\.]+|[^\.]{2,3}\.[^\.]{2})$/) && document.URL.indexOf('q=')!=-1) {
var queryTermsRegExp=new RegExp('q=([^&]+)');
if(queryTermsRegExp.test(document.URL)) {
text=RegExp.$1.replace(/\+/g,' ');
text=decodeURI(text);
}
}
}

// Show a javascript popup asking for search string if necessary
if(!ReferrerOnly) {
if(NoPopup) {
text=p000_UHVar_gText;
} else {
text=(p000_UHOption_AlwaysAsk||!text)?prompt('Highlight keywords:',(p000_UHVar_gText==null?((text==null)?'':text):p000_UHVar_gText)):text;
}
}

// Validate search string and create global vars
if(!p000_UHFunc_CheckSearchString(text))
return;

// Make the magic happen
p000_UHFunc_ShowWindowHighlights(window);

if(p000_UHOption_ShowFollowUp) {
// Show results pane
p000_UHFunc_CreateDiv();
} else {
if(p000_UHOption_ShowStats&&!NoPopup) {
// Show results in a javascript alert
text='';
for (i=0;i < p000_UHVar_gCount.length;i++) {
text+=p000_UHVar_gCount[i]+': '+p000_UHVar_gCount[p000_UHVar_gCount[i]]+'\n';
}
text='Items found:\n'+text+'';
alert(text);
}
}
}

// Highlight search keywords
function UltimateHighlightKeywords(findtext) {
// Sometimes Opera sends the current URL to the script when the Opera search field is empty.
// If this is the case, it must be ignored.
tmp=findtext;
if(tmp.indexOf('#')>-1)
tmp=tmp.substr(0,tmp.indexOf('#'));
if(document.URL!=tmp){
p000_UHVar_gText=findtext;
UltimateHighlight(!p000_UHOption_AlwaysAsk,false);
} else {
UltimateHighlight();
}
}

// Auto-highlighting of search terms when google is referrer
if(p000_UHOption_AutoHighlight){
if( ! location.hostname.match(/(^|\.)google\.([^\.]+|[^\.]{2,3}\.[^\.]{2})$/) ) {
document.addEventListener('load',function(e) {UltimateHighlight(true,true);}, false);
}
}


// IF YOU ARE USING A BUTTON IN YOUR TOOLBAR THAT CAME WITH AN OLD VERSION, YOU EITHER HAVE
// TO UPDATE IT OR TO UNCOMMENT THE FOLLOWING LINE FOR COMPATIBILITY:
// function Highlight() {UltimateHighlight();} function HighlightKeywords(keys) {UltimateHighlightKeywords(keys);}


2、添加Highlight按钮

3、在首选项-高级-内容中,指定JS选项中的用户JS文件路径,为1中自己保存的uhb2.5.js路径。重启。

opera右键定制之三:论坛灌水工具BBCode

整理于亡灵法师的“新手上路指南”文章之10、添加右键菜单的BBCode。另外添加了“超级链接”等。
“超级链接”的“自定义部分”需要自己使用时修改重写。

1、打开standard_menu.ini,找到[Edit Widget Popup Menu]这段。在其中合适的位置添加下面代码:
Submenu, "BBCode", BBCode Menu



2、在[Edit Widget Popup Menu]的附近添加如下代码:
[BBCode Menu]
Submenu, "常用", Codes menu
Submenu, "颜色", Color menu
Submenu, "大小", Size menu
Submenu, "字体", Font menu

[Codes menu]
Item, "超级链接"="Cut & Insert, "[url=" & Paste & Insert, "]自定义部分[/url]""
Item, "链接"="Cut & Insert, "[url]" & Paste & Insert, "[/url]""
Item, "引用"="Cut & Insert, "[quote]" & Paste & Insert, "[/quote]""
Item, "加粗"="Cut & Insert, "[b]" & Paste & Insert, "[/b]""
Item, "图片"="Cut & Insert, "[img]" & Paste & Insert, "[/img]""
Item, "下划线"="Cut & Insert, "[u]" & Paste & Insert, "[/u]""
Item, "Email"="Cut & Insert, "[email=" & Paste & Insert, "]我的Email[/email]""

[Size menu]
Item, "+1"="Cut & Insert, "[size=2]" & Paste & Insert, "[/size]""
Item, "+2"="Cut & Insert, "[size=3]" & Paste & Insert, "[/size]""
Item, "+3"="Cut & Insert, "[size=4]" & Paste & Insert, "[/size]""
Item, "+4"="Cut & Insert, "[size=5]" & Paste & Insert, "[/size]""
Item, "+5"="Cut & Insert, "[size=6]" & Paste & Insert, "[/size]""
Item, "+6"="Cut & Insert, "[size=7]" & Paste & Insert, "[/size]""

[Font menu]
Item, "宋体"="Cut & Insert, "[font=宋体]" & Paste & Insert, "[/font]""
Item, "黑体"="Cut & Insert, "[font=黑体]" & Paste & Insert, "[/font]""
Item, "&Arial"="Cut & Insert, "[font=Arial]" & Paste & Insert, "[/font]""
Item, "&Book Antiqua"="Cut & Insert, "[font=Book Antiqua]" & Paste & Insert, "[/font]""
Item, "Comic &Sans MS"="Cut & Insert, "[font=Comic Sans MS]" & Paste & Insert, "[/font]""
Item, "&Courier"="Cut & Insert, "[font=Courier]" & Paste & Insert, "[/font]""
Item, "&Georgia"="Cut & Insert, "[font=Georgia]" & Paste & Insert, "[/font]""
Item, "&Lucida Handwriting"="Cut & Insert, "[font=Lucida Handwriting Italic]" & Paste & Insert, "[/font]""
Item, "&News Gothic MT"="Cut & Insert, "[font=News Gothic MT]" & Paste & Insert, "[/font]""
Item, "&Palace Script MT"="Cut & Insert, "[font=Palace Script MT]" & Paste & Insert, "[/font]""
Item, "&Times"="Cut & Insert, "[font=Times New Roman]" & Paste & Insert, "[/font]""

[Color menu]
Item, "红"="Cut & Insert, "[color=Red]" & Paste & Insert, "[/color]""
Item, "深红"="Cut & Insert, "[color=Crimson]" & Paste & Insert, "[/color]""
Item, "砖红"="Cut & Insert, "[color=Firebrick]" & Paste & Insert, "[/color]""
Item, "淡紫"="Cut & Insert, "[color=Mediumorchid]" & Paste & Insert, "[/color]""
Item, "蓝"="Cut & Insert, "[color=Blue]" & Paste & Insert, "[/color]""
Item, "品蓝"="Cut & Insert, "[color=Royalblue]" & Paste & Insert, "[/color]""
Item, "深蓝"="Cut & Insert, "[color=Darkblue]" & Paste & Insert, "[/color]""
Item, "绿"="Cut & Insert, "[color=Green]" & Paste & Insert, "[/color]""
Item, "海绿"="Cut & Insert, "[color=Seagreen]" & Paste & Insert, "[/color]""
Item, "酸橙绿"="Cut & Insert, "[color=Limegreen]" & Paste & Insert, "[/color]""
Item, "深青"="Cut & Insert, "[color=Teal]" & Paste & Insert, "[/color]""
Item, "橙色"="Cut & Insert, "[color=Orange]" & Paste & Insert, "[/color]""
Item, "番茄"="Cut & Insert, "[color=Tomato]" & Paste & Insert, "[/color]""
Item, "巧克力"="Cut & Insert, "[color=Chocolate]" & Paste & Insert, "[/color]""
Item, "黄土"="Cut & Insert, "[color=Sienna]" & Paste & Insert, "[/color]""
Item, "褐"="Cut & Insert, "[color=Brown]" & Paste & Insert, "[/color]""


3、修改后standard_menu.ini以UTF-8编码保存。