Archived copy of A Swedish wolf in Norway

Miscellaneous technobabble from a Swede in Norway.

Site-specific preferences in Opera 9

Published: 2005-10-20 19:10:28

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: 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...

Tags: opera browsers

Comments

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

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".

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

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.

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

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.

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

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.

Fufufu writes:

Nevermind, I got that working after trying again.

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?

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.

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"></script> 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.

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.

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.

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... ;)

arnymars: http://weblog.timaltman.com/archive/2006/05/02/site-specific-vs-window-level-preferences

anymars, the situation is still the same, unfortunately.

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.

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@softwolves.pp.se

This was originally posted on My Opera at http://my.opera.com/nafmo/blog/show.dml/47674
Please note that links may be outdated and any information included here may be obsolete.

← Opera Mini på svenska | Tweaking preferences in Opera 9 → | Back to the post index | Back to the archive index | Peter's homepage