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-Tropponon-troppo Thursday, October 20, 2005 11:03:28 PM

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

Peter Kreftingnafmo Friday, October 21, 2005 7:15:16 AM

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 RomanovKildor Friday, October 21, 2005 3:12:12 PM

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

Peter Kreftingnafmo Sunday, October 23, 2005 9:34:11 AM

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 RomanovKildor Monday, October 24, 2005 1:50:48 AM

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

Peter Kreftingnafmo Tuesday, October 25, 2005 5:06:30 AM

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.

FataL Sunday, November 6, 2005 4:42:45 PM

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

Anonymous Wednesday, November 30, 2005 7:11:13 PM

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 Wednesday, November 30, 2005 7:21:33 PM

Fufufu writes: Nevermind, I got that working after trying again.

Anonymous Thursday, December 1, 2005 2:49:20 AM

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 Kreftingnafmo Thursday, December 1, 2005 7:12:26 AM

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 Friday, December 2, 2005 7:13:30 AM

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 Kreftingnafmo Friday, December 2, 2005 7:29:26 AM

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 Saturday, December 3, 2005 3:04:16 AM

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ückauert_matze Thursday, December 8, 2005 12:12:59 PM

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

arnymars Friday, February 12, 2010 6:39:21 PM

Peter

Why Fit-to-Width (Rendering mode) is not allowed in override? Its allowed to override it in Session files, and its often required for sites designed for a particular screen size. Please add it or explain rational.

arnymars Sunday, February 6, 2011 5:06:54 PM

Peter

Any progress on Fit-to-Width being implemented site specific? The link you give contains old simplistic and artificial (while solution is obvious) explanation why nothing was done at that time. The guy no longer works for Opera. How about you? Anyone is assigned to work on this issue? Why its so low priority despite many years of user demand?

Peter Kreftingnafmo Monday, February 7, 2011 10:18:49 PM

anymars, the situation is still the same, unfortunately.

Write a comment

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

February 2012
S M T W T F S
January 2012March 2012
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