Skip navigation.

A Swedish wolf in Norway

Miscellaneous technobabble from a Swede in Norway.

Site-specific preferences in Opera 9

,

The first technical preview of Opera 9 was published today, and it contains the beginnings of support for a feature that has often been requested in our various wish-list forums, namely site-specific preferences. I have been working on this feature for quite some time now. Opera 9 preview is the first publicly available version where this support is available, and now I finally can step forward and say yes, we are indeed working on that.

Site-specific preferences is exactly what it says, the possibility to set preferences specifically on a site. Opera 8 had a preview of this in its ua.ini, which would override the User-Agent identification on different sites. The support for that file has now been withdrawn, and the setting is instead integrated into the general settings file (you can find the name of it by going to opera:about).

To set the User-Agent to always show Opera when visiting www.opera.com (this is the default setting that is downloaded when you select Help → Check for new version):

[Overrides]
www.opera.com

[www.opera.com]
User Agent|Spoof UserAgent ID=1


As you can see from the example, you need to do two things: First, you need to add a section called [Overrides] that lists the hosts for which the overrides are available. Second, you need to add a preference section for that host name where you add the appropriate setting. Since settings are normally identified by a section (here [User Agent]) and a key (here Spoof UserAgent ID) you need to give both, you do that by separating them with a vertical bar character (|). See the ini documentation for more information on the names used in the preferences file. You can also find the list of supported preferences by using the new opera:config interface.

Not all preferences are supported for overrides (yet). Some will not be (it doesn't make sense to switch UI languages when going to a different site), but more are planned. Here are some that are (at least partially) supported that you can play around with:


  • User Agent|Spoof UserAgent ID to set the User-Agent string ("identify as").
  • Extensions|Frames to enable/disable frames.
  • Extensions|Plugins to enable/disable plug-ins.
  • User Prefs|Enable Referrer to enable referrer logging on a specific site. Please note that it is the referring page (i.e the one you are leaving) that decides whether referrer should be enabled or not. This can be useful if you don't normally like sending referrer, but need to access some over-paranoid page that requires them.
  • Sounds|Enabled to let some pages notify you with sound, while keeping others quiet.


There are more supported than are listed here, see also Håvard's blog entry on the subject. Feel free to play around with it. Better documentation will come later, and we of course plan to make them available from the user interface...

Opera Mini på svenskaTweaking preferences in Opera 9

Comments

Non-Troppo 20. October 2005, 23:03

Good stuff! Are only top-level domains supported (I've yet to play properly!), and if so are you planning to extend it?

Peter Krefting 21. October 2005, 07:15

You can only set preferences on domain basis. The settings will cascade, so if you set an override for "opera.com" it will affect both "www.opera.com" and "my.opera.com".

Kostia Romanov 21. October 2005, 15:12

And what about pop-ups?
Can we change blocking per-site?

Peter Krefting 23. October 2005, 09:34

Kildor: Yes, changing popup blocking setting per-site should work. In theory, all the settings available from the quick preferences menu (F12) should be overridable.

Kostia Romanov 24. October 2005, 01:50

nafmo, yes, I found and make this…
But, why I can`t change "Show Images" per-site? It is most usefull…

Peter Krefting 25. October 2005, 05:06

Kildor: "Show images" is currently a per-window setting, which means that the value in preferences is only used when you open a new window, and you can have different settings for different windows. It is yet unclear how this should be combined with site-specific preferences, but I do agree that it would be useful.

Andrey Petrov 6. November 2005, 16:42

Also would be very useful per site zoom and Fit to window width. :up: :wait:

Anonymous 30. November 2005, 19:11

Fufufu writes:

How about blocking scripting for all sites by default but allowing for those in the per-site configuration with Scripting set to 1? I tried blocking javascript by default from within normal Opera prefs, and setting a *.com scripting to 0 but neither worked. I have only been able to block specified sites.

Anonymous 30. November 2005, 19:21

Fufufu writes:

Nevermind, I got that working after trying again.

Anonymous 1. December 2005, 02:49

Fufufu writes:

I'm looking for a way to configure this in a way similar to Firefoxes Noscript extension. It works well to prevent ads and scripts from 3rd party sites. The issue at hand is that if I allow scripting from a top level site, all other websites are allowed to use scripts so long as they are within the page I want javascript allowed for. Any solutions?

Peter Krefting 1. December 2005, 07:12

Fufufu, I'm not quite sure what it is you are tyring to do, but the site-specific preferences are currently keyed to the domain (server name) only, so you will have to enable it for the entire domain or not at all.

Anonymous 2. December 2005, 07:13

Fufufu writes:

You may have to use Firefox Noscript extension to understand exactly what I'm going here. Many pages feature javascript that calls other pages, usually for ads something like script type="text/javascript" language="JavaScript" src="http://pads.vgamin.de/adx.js"> within the www.animesuki.com page. Noscript would offer the ability to deny javascript from vgamin.com, which would effectively destroy the Ad on the page while still allowing scripts from www.animesuki.com so the site itself functioned properly. I tried setting vgamin.com=0 to block all from that specified site. I'm not sure if the new site-specific preferences in opera can offer exactly what im looking for in control for scripting within sites like the noscript firefox extension good. I find that i like the opera UI a lot and have got everything setup for use except a good way to control specific sites as well as firefox.

Peter Krefting 2. December 2005, 07:29

The domain you disable scripting for is the one that the page you are viewing is served in, not the one that the script comes from, so I don't think you will be able to do what you want by only using Opera 9's settings.

Anonymous 3. December 2005, 03:04

Fufufu writes:

Yes I realize it is within the page i am viewing. I was mostly looking for a way to block calls from any site(maybe setting vgamin.com=0) so opera will not load anything(images, frames, ect...) that is from the site. The difference between this, and say a filter.ini is that it would include a UI in later opera 9 revisions. Oh well, wishing for too much.

Tilmann Rückauer 8. December 2005, 12:12

If you whish to block content from a specific site entirely, you might want to use the filter.ini.

Need more information? There you go... :wink:

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

Download Opera, the fastest and most secure browser
December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31