Opera Nalakuvara, customized Taiwanese browser — Part 2: Tweaking Opera default settings

By Jedi Lin

Introduction

In the first part of my series covering how I created the customized Opera Nalakuvara package, I looked at aspects such as naming it, community research, getting together my toolset, getting the installation procedure right, and working out what files I need to customize. In this, the second part, we get to the fun bit — actually starting to make those customizations! A lot of the things I wanted to achieve with Nalakuvara are available by just tweaking default settings and files that Opera already has available to it; this is what I’ll cover here. We’ll get to the creation of third party additions in part three.

The contents of this article are as follows:

Editing opera:config

First thing first. Most of the features I wanted to add want are available through simply changing Opera’s settings on the opera:config page. The below table details all the changes I implemented in the Nalakuvara package — these changes made to OPERA_INSTALL_PATH\custom\defaults\operaprefs.ini (never edit this while Opera is running).

[User Prefs]
Feature opera:config Link Opera Default Nalakuvara Tweak
Enable Mouse Gesture opera:config#UserPrefs|EnableGesture 0 1
Enable All Drag & Drop Features opera:config#UserPrefs|EnableDrag 247 255 (This enables all drag operation, according to Opera Knowledge Base)
Double Click on Tab to Close It opera:config#UserPrefs|DoubleclicktoCloseTab 0 1
Open new Tab/Window for each new link, search and bookmark, rather than re-use current one. Make new Tab/Window active. opera:config#UserPrefs|NewWindow 0 1
Open New Tab/Window for each new link, search and bookmark, rather than re-use current one, but open it in the background. opera:config#UserPrefs|OpenNewWindowinBackground 0 1
Show panel toggle area at the window edge So that users can toggle panel on or off more easily opera:config#UserPrefs|Showpaneltoggle 0 1

The below screenshots show some of these features in action.

Drag and Drop a link to download panel

Figure 1: Drag a download link to the downloads panel to start downloading.

Double-click to close tab

Figure 2: Double-click on a tab to close it.

Panel toggle area with panel hidden

Figure 3-1: Click on panel toggle area to bring up panel.

Panel toggle area with panel shown

Figure 3-1: Click on panel toggle area to close panel. This is quite handy especially when Opera is maximized. (One just need to move mouse to the most left and click.)

[Fonts]
Feature opera:config Link Opera Default Nalakuvara Tweak
Browser dialog fonts for traditional Chinese opera:config#Fonts|Dialog 15,4,0,0,0,0,SimSun 12,4,0,0,0,0,新細明體
Browser menu fonts for traditional Chinese opera:config#Fonts|Menu 15,4,0,0,0,0,SimSun 12,4,0,0,0,0,新細明體
Browser panel fonts for traditional Chinese opera:config#Fonts|Panel 15,4,0,0,0,0,SimSun 12,4,0,0,0,0,新細明體
Browser toolbar fonts for traditional Chinese opera:config#Fonts|Toolbar 15,4,0,0,0,0,SimSun 12,4,0,0,0,0,新細明體
Browser tooltip fonts for traditional Chinese opera:config#Fonts|Tooltip 15,4,0,0,0,0,SimSun 12,4,0,0,0,0,新細明體

The reason to change browser fonts is that SimSun looks good in Simplified Chinese, but horrible in Traditional Chinese — Figures 4 and 5 illustrate the difference.

Original Opera uses SimSun as default UI font

Figure 4: The original Opera in Traditional Chinese Windows. Take a close look at UI fonts: the menu font, the tab font, and the address bar font. SimSun does not do a good job here.

Opera Nalakuvara uses 新細明體 as default UI font

Figure 5: Opera Nalakuvara in Traditional Chinese Windows. With 新細明體 as default UI font, now it is better.

[Network]
Feature opera:config Link Opera Default Nalakuvara Tweak
(HTTP) Accept traditional Chinese and English, avoid simplified Chinese opera:config#Network|HTTPAcceptLanguage zh-TW,zh;q=0.9,en;q=0.8 zh-tw,en;q=0.9

We also have to tweak the default HTTP Accept languages to rule out zh, otherwise some sites wrongly send Simplified Chinese content to Taiwanese users. Traditional Chinese and Simplified Chinese are really two different languages; treating one as a subset of the other causes problems.

[Network]
Feature opera:config Link Opera Default Nalakuvara Tweak
Do not check local host name while entering invalid URL opera:config#Network|CheckLocalHostName 1 0
Do not append host name prefix/postfix while entering invalid URL opera:config#Network|EnableHostNameExpansion 1 0
Use Web (Search Engine) to Lookup Host Name While Entering Invalid URL opera:config#Network|EnableHostNameWebLookup 0 1
The web search URL to lookup host name opera:config#Network|HostNameWebLookupAddress http://www.google.com/search?q=%s&sourceid=opera&num=%i&ie=utf-8&oe=utf-8

Host Name Expansion (append prefix/postfix to invalid host name automatically) is also disabled, because Traditional Chinese host names such as http://網頁設計.tw/ are still not popular in Taiwan, so enabling this expansion often brings users to docked page of domain name retailers. Instead, Nalakuvara turns Address Bar into Google search if one entered an invalid URI.

The full edits to OPERA_INSTALL_PATH\custom\defaults\operaprefs.ini look like so:

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

[User Prefs]
Enable Gesture=1
Enable Drag=255
Doubleclick to Close Tab=1
New Window=1
Open New Window in Background=1
Show panel toggle=1

[Fonts]
Menu=12,4,0,0,0,0,新細明體
Toolbar=12,4,0,0,0,0,新細明體
Dialog=12,4,0,0,0,0,新細明體
Panel=12,4,0,0,0,0,新細明體
Tooltip=12,4,0,0,0,0,新細明體

[Network]
HTTP Accept Language=zh-tw,en;q=0.9
Check Local HostName=0
Enable HostName Expansion=0
Enable HostName Web Lookup=1
HostName Web Lookup Address=http://www.google.com/search?q=%s&sourceid=opera&num=%i&ie=utf-8&oe=utf-8

Additional Linux and FreeBSD changes

新細明體 (MingLiU) is the default system font on the Traditional Chinese Windows, but this font is not available on Linux/FreeBSD. Linux/FreeBSD versions of Opera also have a bug that causes Traditional Chinese and Simplified Chinese fonts to be mixed up in web contents, resulting in inconsistency and ugly display. The workaround is to use AR PL UMing TW MBE and AR PL UKai TW MBE for browser UI and default (preferred) fonts. So on Linux and FreeBSD I made the following additional changes:

[Fonts]
Feature opera:config Link Opera Default Nalakuvara Tweak
Browser dialog fonts for Traditional Chinese opera:config#Fonts|Dialog 12,4,0,0,0,0,Nimbus Sans L [urw] 14,4,0,0,0,0,AR PL UMing TW MBE [unknown]
Browser menu fonts for Traditional Chinese opera:config#Fonts|Menu 12,4,0,0,0,0,Nimbus Sans L [urw] 14,4,0,0,0,0,AR PL UMing TW MBE [unknown]
Browser panel fonts for Traditional Chinese opera:config#Fonts|Panel 12,4,0,0,0,0,Nimbus Sans L [urw] 14,4,0,0,0,0,AR PL UMing TW MBE [unknown]
Browser toolbar fonts for Traditional Chinese opera:config#Fonts|Toolbar 12,4,0,0,0,0,Nimbus Sans L [urw] 14,4,0,0,0,0,AR PL UMing TW MBE [unknown]
Browser tooltip fonts for Traditional Chinese opera:config#Fonts|Tooltip 12,4,0,0,0,0,Nimbus Sans L [urw] 14,4,0,0,0,0,AR PL UMing TW MBE [unknown]

Just like in Windows, these are for the UI font. This time, we have to tweak default (preferred) web content font, too:

[Fonts]
Feature opera:config Link Opera Default Nalakuvara Tweak
Web page normal text font opera:config#Fonts|Normal 16,4,0,0,0,0,Nimbus Roman No9 L [urw] 16,4,0,0,0,0,AR PL UMing TW MBE [unknown]
Web page <pre> text font opera:config#Fonts|PRE 16,4,0,0,0,0,Nimbus Mono L [urw] 16,4,0,0,0,0,AR PL UKai TW MBE [unknown]
[Preferred fonts]
Feature opera:config Link Opera Default Nalakuvara Tweak
Preferred traditional Chinese font N/A Nimbus Sans L [urw] AR PL UMing TW MBE [unknown]
[Preferred fonts monospace]
Feature opera:config Link Opera Default Nalakuvara Tweak
Preferred traditional Chinese monospace font N/A Nimbus Mono L [urw] AR PL UKai TW MBE [unknown]
[CSS Generic Font Family]
Feature opera:config Link Opera Default Nalakuvara Tweak
Generic CSS sans-serif font family opera:config#CSSGenericFontFamily|Sans-Serif Nimbus Roman No9 L [urw] AR PL UMing TW MBE [unknown]
Generic CSS serif font family opera:config#CSSGenericFontFamily|Serif Nimbus Mono L [urw] AR PL UKai TW MBE [unknown]

Take a close look at the UI fonts and the web content fonts in Figure 6, and compare it to Figure 7. Sadly the web content fonts in Figure 6 are blurry and inconsistent.

Original Opera in Fedora 11

Figure 6: The original Opera in Traditional Chinese Fedora 11.

Opera Nalakuvara in Fedora 11

Figure 7: Opera Nalakuvara in Traditional Chinese Fedora 11. The UI fonts and preferred web content fonts are not perfect dealing with English characters yet, but at least much clear and readable.

This results in the following modified /usr/share/opera/operadefaults.ini:

; Put any default settings here that are overridable by users

[User Prefs]
Enable Gesture=1
Enable Drag=255
Doubleclick to Close Tab=1
New Window=1
Open New Window in Background=1
Show panel toggle=1
NavigationBar Alignment=2
NavigationBar Auto Alignment=1

[Network]
HTTP Accept Language=zh-tw,en;q=0.9
Check Local HostName=0
Enable HostName Expansion=0
Enable HostName Web Lookup=1
HostName Web Lookup Address=http://www.google.com/search?q=%s&sourceid=opera&num=%i&ie=utf-8&oe=utf-8

[Fonts]
Menu=14,4,0,0,0,0,AR PL UMing TW MBE [unknown]
Toolbar=14,4,0,0,0,0,AR PL UMing TW MBE [unknown]
Dialog=14,4,0,0,0,0,AR PL UMing TW MBE [unknown]
Panel=14,4,0,0,0,0,AR PL UMing TW MBE [unknown]
Tooltip=14,4,0,0,0,0,AR PL UMing TW MBE [unknown]
Normal=16,4,0,0,0,0,AR PL UMing TW MBE [unknown]
PRE=16,4,0,0,0,0,AR PL UKai TW MBE [unknown]

[Preferred fonts]
59=AR PL UMing TW MBE [unknown]

[Preferred fonts monospace]
59=AR PL UKai TW MBE [unknown]

[CSS Generic Font Family]
Sans-Serif=AR PL UMing TW MBE [unknown]
Serif=AR PL UKai TW MBE [unknown]

This is just a workaround and certainly not ideal, as Ming (明體) is not a Sans-Serif font. When using this setting, English language web pages don’t look very good. Some Linux distributions are more lucky — Ubuntu has two traditional Chinese gothic font (文泉驛等寬正黑 and 文泉驛正黑, monospace and not) installed by default, which are Sans-Serif, and therefore work better in this situation. That is why Nalakuvara provides an alternative default for Ubuntu users:

[Fonts]
Feature opera:config Link Opera Default Nalakuvara Tweak
Browser dialog fonts for traditional Chinese opera:config#Fonts|Dialog 12,4,0,0,0,0,Nimbus Sans L [urw] 14,4,0,0,0,0,文泉驛正黑 [unknown]
Browser menu fonts for traditional Chinese opera:config#Fonts|Menu 12,4,0,0,0,0,Nimbus Sans L [urw] 14,4,0,0,0,0,文泉驛正黑 [unknown]
Browser panel fonts for traditional Chinese opera:config#Fonts|Panel 12,4,0,0,0,0,Nimbus Sans L [urw] 14,4,0,0,0,0,文泉驛正黑 [unknown]
Browser toolbar fonts for traditional Chinese opera:config#Fonts|Toolbar 12,4,0,0,0,0,Nimbus Sans L [urw] 14,4,0,0,0,0,文泉驛正黑 [unknown]
Browser tooltip fonts for traditional Chinese opera:config#Fonts|Tooltip 12,4,0,0,0,0,Nimbus Sans L [urw] 14,4,0,0,0,0,文泉驛正黑 [unknown]
[Fonts]
Feature opera:config Link Opera Default Nalakuvara Tweak
Web page normal text font opera:config#Fonts|Normal 16,4,0,0,0,0,Nimbus Roman No9 L [urw] 16,4,0,0,0,0,文泉驛正黑 [unknown]
Web page <pre> text font opera:config#Fonts|PRE 16,4,0,0,0,0,Nimbus Mono L [urw] 16,4,0,0,0,0,文泉驛等寬正黑 [unknown]
[Preferred fonts]
Feature opera:config Link Opera Default Nalakuvara Tweak
Preferred traditional Chinese font N/A Nimbus Sans L [urw] 文泉驛正黑 [unknown]
[Preferred fonts monospace]
Feature opera:config Link Opera Default Nalakuvara Tweak
Preferred traditional Chinese monospace font N/A Nimbus Mono L [urw] 文泉驛等寬正黑 [unknown]
[CSS Generic Font Family]
Feature opera:config Link Opera Default Nalakuvara Tweak
Generic CSS sans-serif font family opera:config#CSSGenericFontFamily|Sans-Serif Nimbus Roman No9 L [urw] 文泉驛正黑 [unknown]
Generic CSS serif font family opera:config#CSSGenericFontFamily|Serif Nimbus Mono L [urw] AR PL UKai TW MBE [unknown]

Take a close look at the UI fonts and web content fonts in Figure 8. Sadly, the web content fonts are blurry and inconsistent, and the problem is much obvious than in Fedora. If you can't see what is wrong here, try comparing it with Figure 9.

Original Opera in Ubuntu 9.10

Figure 8: The original Opera in Traditional Chinese Ubuntu 9.10.

Opera Nalakuvara in Ubuntu 9.10

Figure 9: Opera Nalakuvara in Traditional Chinese Ubuntu 9.10. The UI fonts and preferred web content fonts are much clear and readable, and behave better when mixed with English characters.

Ubuntu users get the following /usr/share/opera/operadefaults.ini file:

; Put any default settings here that are overridable by users

[User Prefs]
Enable Gesture=1
Enable Drag=255
Doubleclick to Close Tab=1
New Window=1
Open New Window in Background=1
Show panel toggle=1
NavigationBar Alignment=2
NavigationBar Auto Alignment=1

[Network]
HTTP Accept Language=zh-tw,en;q=0.9
Check Local HostName=0
Enable HostName Expansion=0
Enable HostName Web Lookup=1
HostName Web Lookup Address=http://www.google.com/search?q=%s&sourceid=opera&num=%i&ie=utf-8&oe=utf-8

[Fonts]
Menu=14,4,0,0,0,0,文泉驛正黑 [unknown]
Toolbar=14,4,0,0,0,0,文泉驛正黑 [unknown]
Dialog=14,4,0,0,0,0,文泉驛正黑 [unknown]
Panel=14,4,0,0,0,0,文泉驛正黑 [unknown]
Tooltip=14,4,0,0,0,0,文泉驛正黑 [unknown]
Normal=16,4,0,0,0,0,文泉驛正黑 [unknown]
PRE=16,4,0,0,0,0,文泉驛等寬正黑 [unknown]

[Preferred fonts]
59=文泉驛正黑 [unknown]

[Preferred fonts monospace]
59=文泉驛等寬正黑 [unknown]

[CSS Generic Font Family]
Sans-Serif=文泉驛正黑 [unknown]
Serif=AR PL UKai TW MBE [unknown]

It is very important to ensure UTF-8 encoding is used in the .ini files, especially when dealing with preferences in Traditional Chinese such as font names.

Updating the default mail providers

Opera by default includes some web mail service providers — the details of these are stored in OPERA_INSTALL_PATH\defaults\webmailproviders.ini. By editing this file, you can comment out any that are unpopular in your locale, and add in more popular ones. Nalakuvara’s OPERA_INSTALL_PATH\defaults\webmailproviders.ini file has had several providers added in that are more popular for Taiwanese users. The full file looks like so:

Opera Preferences version 2.1
; Do not edit this file while Opera is running
; This file is stored in UTF-8 encoding
; %t = to
; %j = subject
; %m = body
; %k = cc
; %l = bcc
; %s = full mailto URI
; i.e., %s = to=%t&subject=%j&body=%m&cc=%k&bcc=%l

;[Yandex]
;ID=4
;URL=http://mail.yandex.ru/compose?mailto=%s
;ICON=http://img.yandex.net/i/favicon.ico

;[Fastmail]
;ID=5
;URL=http://www.fastmail.fm/action/compose/?mailto=%s
;ICON=http://www.fastmail.fm/favicon.ico

[Opera Web Mail]
ID=6
URL=http://mymail.operamail.com/scripts/mail/Outblaze.mail?compose=1&did=1&a=1&to=%t&subject=%j&body=%m&cc=%k
ICON=http://www.opera.com/favicon.ico

;[Mail.ru]
;ID=7
;URL=http://win.mail.ru/cgi-bin/sentmsg?To=%t&CC=%k&BCC=%l&Subject=%j&Body=%m
;ICON=http://img.imgsmail.ru/r/favicon.ico

[Gmail - HTML5]
ID=8
URL=https://mail.google.com/mail/?extsrc=mailto&url=%s
ICON=https://mail.google.com/favicon.ico

[Gmail]
ID=9
URL=https://mail.google.com/mail/?compose=1&view=cm&fs=1&to=%t&su=%j&body=%m&cc=%k&bcc=%l
ICON=https://mail.google.com/favicon.ico

[Hotmail]
ID=10
URL=http://mail.live.com/mail/EditMessageLight.aspx?n=&to=%t&cc=%k&subject=%j&body=%m&bcc=%l
ICON=http://mail.live.com/favicon.ico

[Ymail - Generic]
ID=11
URL=http://compose.mail.yahoo.com/?To=%t&Subj=%j&Body=%m&Cc=%k&Bcc=%l
ICON=http://mail.yahoo.com/favicon.ico

[Ymail - Classic Compose + New UI]
ID=12
URL=http://us.mg1.mail.yahoo.com/mc/compose?ymv=0&body=%m&Subj=%j&to=%t&cc=%k&bcc=%l
ICON=http://mail.yahoo.com/favicon.ico

[Ymail - New UI + Blocking Workaround]
ID=13
URL=http://us.mg1.mail.yahoo.com/dc/launch?sysreq=ignore&action=compose&login=1&To=%t&Subj=%j&Cc=%k&Bcc=%l&Body=%m
ICON=http://mail.yahoo.com/favicon.ico

[Mail2000]
ID=14
URL=http://www.mail2000.com.tw/cgi-bin/genMail.pl?adr=%t&content=%m&subject=%j
ICON=http://www.mail2000.com.tw/favicon.ico

[PChome Mail]
ID=20
URL=http://mail.pchome.com.tw/compose_content?MailTo=%t&MailSubject=%j&MailCc=%k&MailBcc=%l&text2=%m
ICON=http://www.pchome.com.tw/favicon.ico

[Webmail@URL (wm1)]
ID=21
URL=http://wm1.url.com.tw/src/compose.php?mailbox=INBOX&startMessage=1&send_to=%t&sed_to_cc=%k&send_to_bcc=%l&subject=%j&body=%m
ICON=http://www.url.com.tw/images/url.ico

[Webmail@URL (wm2)]
ID=22
URL=http://wm2.url.com.tw/src/compose.php?mailbox=INBOX&startMessage=1&send_to=%t&sed_to_cc=%k&send_to_bcc=%l&subject=%j&body=%m
ICON=http://www.url.com.tw/images/url.ico

[Webmail@URL (wm3)]
ID=23
URL=http://wm3.url.com.tw/src/compose.php?mailbox=INBOX&startMessage=1&send_to=%t&sed_to_cc=%k&send_to_bcc=%l&subject=%j&body=%m
ICON=http://www.url.com.tw/images/url.ico

[Webmail@URL (wm4)]
ID=24
URL=http://wm4.url.com.tw/src/compose.php?mailbox=INBOX&startMessage=1&send_to=%t&sed_to_cc=%k&send_to_bcc=%l&subject=%j&body=%m
ICON=http://www.url.com.tw/images/url.ico

[Webmail@URL (wm5)]
ID=25
URL=http://wm5.url.com.tw/src/compose.php?mailbox=INBOX&startMessage=1&send_to=%t&sed_to_cc=%k&send_to_bcc=%l&subject=%j&body=%m
ICON=http://www.url.com.tw/images/url.ico

[Webmail@URL (wm6)]
ID=26
URL=http://wm6.url.com.tw/src/compose.php?mailbox=INBOX&startMessage=1&send_to=%t&sed_to_cc=%k&send_to_bcc=%l&subject=%j&body=%m
ICON=http://www.url.com.tw/images/url.ico

[Webmail@URL (wm7)]
ID=27
URL=http://wm7.url.com.tw/src/compose.php?mailbox=INBOX&startMessage=1&send_to=%t&sed_to_cc=%k&send_to_bcc=%l&subject=%j&body=%m
ICON=http://www.url.com.tw/images/url.ico

[Webmail@URL (wm8)]
ID=28
URL=http://wm8.url.com.tw/src/compose.php?mailbox=INBOX&startMessage=1&send_to=%t&sed_to_cc=%k&send_to_bcc=%l&subject=%j&body=%m
ICON=http://www.url.com.tw/images/url.ico

[Webmail@URL (wm9)]
ID=29
URL=http://wm9.url.com.tw/src/compose.php?mailbox=INBOX&startMessage=1&send_to=%t&sed_to_cc=%k&send_to_bcc=%l&subject=%j&body=%m
ICON=http://www.url.com.tw/images/url.ico

[Webmail@URL (wm10)]
ID=30
URL=http://wm10.url.com.tw/src/compose.php?mailbox=INBOX&startMessage=1&send_to=%t&sed_to_cc=%k&send_to_bcc=%l&subject=%j&body=%m
ICON=http://www.url.com.tw/images/url.ico

Figures 10 and 11 illustrate the difference between the original Opera defail mail providers, and the Nalakuvara default mail providers.

Webmail providers list in the original Opera

Figure 10: The webmail providers list in the original Opera.

Webmail providers list in Opera Nalakuvara

Figure 11: The webmail providers list in Opera Nalakuvara. All these webmail services are commonly used in Taiwan.

Modifying the Fast Forward button behaviour

The behaviour of the Fast Forward button is controlled by the OPERA_INSTALL_PATH\custom\defaults\fastforward.ini file; Nalakuvara has taken this file from Ibis, which adds more strings to trigger the Fast Forward button, and added some additional strings used in Taiwan. Here is the modified part of it:

;Chinese (traditional and simplified)
前进
继续
翻页
下页
下頁
下篇
后页
后页>
往后>>
下一頁
下一页=101
下一页>
下一页>>
下一个
下一张
下一张 >
下一幅
下一幅 >
下一章
下一节
下一節
下一篇
后一页=90
下一步
翻下页
翻下頁
看下一页
下一页(快捷键→)
"[下頁]"
"[下页]"
"[继续]"
"[下一頁]"
"[下一页]"
"[翻下頁]"
"[翻下页]"
下一張 (C)
下一頁 (C)

Modifying default search engines

Default bookmarks and searches can also be modified. It certainly makes sense to modify these options just for specific locales, so for example, in Nalakuvara more search engine options (more popular search engines in Taiwan) have been added to the OPERA_INSTALL_PATH\locale\zh-tw\search.ini file, which only takes effect while using the Traditional Chinese Opera UI. The modified file is as follows:

[Search Engine 1]
UNIQUEID=7A8CADE6677811DDBA4B5E9D55D89593
Name=
URL=http://www.google.com/search?q=%s&sourceid=opera&num=%i&ie=utf-8&oe=utf-8
ICON=http://redir.opera.com/favicons/google/favicon.ico
Query=
Key=g
Is post=0
Has endseparator=0
Encoding=utf-8
Search Type=0
Verbtext=0
Position=-1
Nameid=17171
UseTLD=1

[Search Engine 2]
UNIQUEID=C62302A2FBB8E8469557BD47409F8747
Name=Yahoo!奇摩搜尋
Verbtext=0
URL=http://tw.search.yahoo.com/search?ei=&fr=sfp&fr2=&p=%s&_adv_prop=web&fl=0&vl=0&vf=all&vd=all&iscqry=
ICON=http://tw.search.yahoo.com/favicon.ico
Query=
Key=ys
Is post=0
Has endseparator=0
Encoding=utf-8
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 3]
UNIQUEID=8FF7B2066FB77449B62B04D1D40EF8F8
Name=Bing
Verbtext=0
URL=http://www.bing.com/search?q=%s&go=&form=QBLH&filt=all
ICON=http://www.bing.com/favicon.ico
Query=
Key=b
Is post=0
Has endseparator=0
Encoding=utf-8
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 4]
UNIQUEID=AE41FF7A5FC011DDAE47DBEF55D89593
Name=維基百科
URL=http://zh.wikipedia.org/wiki/Special:Search?search=%s
ICON=http://redir.opera.com/favicons/wikipedia/favicon.ico
Query=
Key=w
Is post=0
Has endseparator=0
Encoding=utf-8
Search Type=0
Verbtext=0
Position=-1

<!-- skip past unmodified content -->

[Search Engine 26]
UNIQUEID=17488DC9AE770545B642C790CAB3C9D2
Name=Internet Archive
Verbtext=0
URL=http://web.archive.org/web/*%s
ICON=http://www.archive.org/images/logo-16.jpg
Query=
Key=ia
Is post=0
Has endseparator=0
Encoding=big5
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 27]
UNIQUEID=829D47CC797B29459E6F38E927BABCF2
Name=全國法規資料庫法規名稱檢索
Verbtext=0
URL=http://law.moj.gov.tw/Scripts/SimpleQ.asp?rb=lname&K1=%s
Query=
Key=jn
Is post=0
Has endseparator=0
Encoding=big5
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 28]
UNIQUEID=B980F29D8FEF9A4D896C5D035DF1270D
Name=全國法規資料庫法條內容檢索
Verbtext=0
URL=http://law.moj.gov.tw/Scripts/SimpleQ1.asp?K1=%s&K2=&K3=&K4=&Fusekey=%B1%60%A5%CE%BBy%B7J&rb=la
Query=
Key=j
Is post=0
Has endseparator=0
Encoding=big5
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 29]
UNIQUEID=F290D3865FC011DD83CDD4F355D89593
Name=
URL=http://redir.opera.com/amazon/?q=%s
ICON=http://redir.opera.com/favicons/amazon/favicon.ico
Query=
Key=z
Is post=0
Has endseparator=0
Encoding=utf-8
Search Type=0
Verbtext=0
Nameid=69678
Position=-1

[Search Engine 30]
UNIQUEID=82EB048A5FCE11DDAFCFE0AA56D89593
Name=
URL=http://redir.opera.com/ebay/?q=%s
ICON=http://redir.opera.com/favicons/ebay/favicon.ico
Query=
Key=e
Is post=0
Has endseparator=0
Encoding=utf-8
Search Type=0
Verbtext=0
Position=-1
Nameid=69679

[Search Engine 31]
UNIQUEID=2C42B3DE30288847A11B871C19A3D7E2
Name=PChome線上購物
Verbtext=0
URL=http://shopping.pchome.com.tw/?m=search&f=doSearch&STYPE=&target=%s&Submit=%A7%E4%B0%D3%AB%7E
ICON=http://shopping.pchome.com.tw/favicon.ico
Query=
Key=pch
Is post=0
Has endseparator=0
Encoding=big5
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 32]
UNIQUEID=6EA8C2D1619F7442827906A8D25E53B0
Name=露天拍賣
Verbtext=0
URL=http://search.ruten.com.tw/search/s000.php?searchfrom=indexbar&k=%s&t=0
ICON=http://www.ruten.com.tw/favicon.ico
Query=
Key=rb
Is post=0
Has endseparator=0
Encoding=big5
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 33]
UNIQUEID=77C25A05B0E75A4B81DBE19E88644DC5
Name=Yahoo!奇摩拍賣
Verbtext=0
URL=http://tw.search.bid.yahoo.com/search/ac?ei=BIG-5&p=%s
ICON=http://tw.bid.yahoo.com/favicon.ico
Query=
Key=yb
Is post=0
Has endseparator=0
Encoding=big5
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 34]
UNIQUEID=A56370F8D5684A4A82184AA4B796FFCD
Name=射手網字幕
Verbtext=0
URL=http://shooter.cn/sub/?searchword=%s&x=0&y=0
ICON=http://shooter.cn/favicon.ico
Query=
Key=sub
Is post=0
Has endseparator=0
Encoding=big5
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 35]
UNIQUEID=F182FB89FD59FB4BAB0CD8C71E2C3234
Name=海盜灣 BT
Verbtext=0
URL=http://thepiratebay.org/search/%s/0/99/0
ICON=http://thepiratebay.org/favicon.ico
Query=
Key=tpb
Is post=0
Has endseparator=0
Encoding=big5
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 36]
UNIQUEID=016F899833096540B36B4F52569C723A
Name=Mininova BT
Verbtext=0
URL=http://www.mininova.org/search/?search=%s
ICON=http://mnstat.com/images/favicon.ico
Query=
Key=m
Is post=0
Has endseparator=0
Encoding=big5
Search Type=0
Position=-1
Nameid=0
Deleted=0

[Search Engine 37]
UNIQUEID=AF5D5F3752D1F84BB2F3D54F9EDD4999
Name=isoHunt BT
Verbtext=0
URL=http://isohunt.com/torrents.php?ihq=%s
ICON=http://isohunt.com/favicon.ico
Query=
Key=ih
Is post=0
Has endseparator=0
Encoding=big5
Search Type=0
Position=-1
Nameid=0
Deleted=0

Figures 11 and 12 show the difference between the default search engines list in standard Opera, and the default search engines list in Nalakuvara. If you use Opera Nalakuvara with an UI other than Traditional Chinese, you will not see these.

Search engines list in the original Opera

Figure 12: The search engines list in the original Opera.

Search engines list in Opera Nalakuvara

Figure 13: The search engines list in Opera Nalakuvara.

search.ini does more than just defining default searches. I will talk about this later in part three of my series.

Modifying default bookmarks

Default bookmarks are locale-based, too. The OPERA_INSTALL_PATH\locale\zh-tw\bookmarks.adr file for Traditional Chinese UI users strips out entries that are unpopular in that locale, and adds important Traditional Chinese resources about Opera — the modified Nalakuvara file looks like so:

Opera Hotlist version 2.0
Options: encoding = utf8, version=3

#FOLDER
ID=11
NAME=回收桶
TRASH FOLDER=YES
UNIQUEID=4E1601F6F30511DB9CA51FD19A7AAECA

-

#FOLDER
ID=12
NAME=Opera
UNIQUEID=826CF25AF11C491899711FC93513A4F4

#URL
ID=13
NAME=Download Opera
URL=http://www.opera.com/download/
VISITED=1252173878
UNIQUEID=6346265318C548DC831B7DF6D8EBB577

#URL
ID=14
NAME=My Opera Community
URL=http://my.opera.com/
ON PERSONALBAR=YES
PERSONALBAR_POS=1
UNIQUEID=6081957B53904ED6BAD072D157C8D408
ICONFILE=my.opera.com.ico

#URL
ID=15
NAME=Opera Web Mail
URL=http://www.operamail.com/
UNIQUEID=CF79297898B24364A89ED412D9B43B89

#URL
ID=16
NAME=Support Desk
URL=http://www.opera.com/support/
VISITED=1252173859
UNIQUEID=BDBBEF1FCB2844A980752782E0D9670C

#URL
ID=17
NAME=Opera Nalakuvara 三太子
URL=http://jedi.org/p4/Opera/pub/
CREATED=1252173550
DESCRIPTION=
UNIQUEID=D4A427CF2F790642909162DED1FCA7D8

#URL
ID=18
NAME=Opera 官方論壇正體中文版
URL=http://my.opera.com/tradchinese/forums/
CREATED=1252173758
DESCRIPTION=
UNIQUEID=115491135268A74C8E5B2E60C98C13C2

#URL
ID=19
NAME=Opera第一手最新消息繁體中文版
URL=http://my.opera.com/ting0619/blog/
CREATED=1252173839
DESCRIPTION=
UNIQUEID=AFC07AA46717884BB243A755BD59228A

Please also notice that bookmarks.adr has to be in UTF-8 encoding, too.

User agent modification

Opera has a built-in function to spoof the User Agent string. This is because some web sites reject Opera for no good reason — the sites would work fine in Opera, except that they arbitrarily block Opera based on User Agent strings. Once Opera spoofs itself as Firefox or Internet Explorer, everything usually works fine.

I can use this functionality to modify the user agents Opera can spoof as. Each time Opera is running, it checks and downloads an up-to-date spoof list to %APPDATA%\Opera\OPERA_DIR_NAME\override_downloaded.ini. Editing this file is a waste of time, since it is always overwritten. All manual site preferences (including spoof User Agent strings) are stored at %APPDATA%\Opera\OPERA_DIR_NAME\override.ini, so that is our true target. This file finally looks like so:

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

[Overrides]
soweb.kcg.gov.tw
web2.cc.ntu.edu.tw

[soweb.kcg.gov.tw]
User Agent|Spoof UserAgent ID=5

[web2.cc.ntu.edu.tw]
User Agent|Spoof UserAgent ID=5

The numeric value of User Agent|Spoof UserAgent ID means:

  • 1: Identify as Opera, ie, something like Opera/9.80 (Windows NT 5.1; U; zh-tw) Presto/2.2.15 Version/10.00 for 10.00, Opera/9.80 (Windows NT 5.1; U; zh-tw) Presto/2.2.15 Version/10.10 for 10.10, and Opera/9.80 (Windows NT 5.1; U; en) Presto/2.5.20 Version/10.50 for 10.50 Labs snapshot
  • 2: Identify as Firefox, ie, something like Mozilla/5.0 (Windows NT 5.1; U; zh-tw; rv:1.8.1) Gecko/20061208 Firefox/2.0.0 Opera 10.00
  • 3: Identify as Internet Explorer, ie, something like Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; zh-tw) Opera 10.00
  • 4: Spoof as Firefox, ie, something like Mozilla/5.0 (Windows NT 5.1; U; zh-tw; rv:1.8.1) Gecko/20061208 Firefox/2.0.0
  • 5: Spoof as Internet Explorer, ie, something like Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; zh-tw)

Those listed sites are from user reports. I will talk about these later in part four, when we look at user feedback.

Summary

In this article, I looked at implementing some of the Nalakuvara customizations, including modifications to opera:config, and changes to default mail providers, fast forward behaviour, search engines, bookmarks and user agent spoofing. The next article in the series will cover the creation of the third party code present in Nalakuvara, including UserJS and more.

This article is licensed under a Creative Commons Attribution, Non Commercial - Share Alike 2.5 license.

Comments

The forum archive of this article is still available on My Opera.

No new comments accepted.