HTML, CSS, JS and other unsorted stuff

Subscribe to RSS feed

Sticky post

In Blog Links

cleanPages extension service page

All cleanPages related articles.

offline arc90 readability userJS+Button for Opera before version 11

WOT (Web of Trust) Userscript for all users who can't use the extension or who don't like to set up a WOT account just to see the results. It supports more search engines natively too ...
(All posts related to WOT)

Read more...

Opera 12 release date

,

Originally posted by desktopteam:

We are getting close to the first 12.00 Release Candidate (...)

Source

My guess:
Before June, I'd say RC1 at the 26th ...

What do you think?

Buttonator 0.9.28 - Opera button generator reloaded

, , ,

ButtOnator - the Opera button generator updated with the new actions and skin icon codes of Opera 12.

With the buttonator you can build normal Opera buttons that contain the built in button actions - but that's not all:

You can insert bookmarklets or normal formatted JavaScript as first parameter. The buttonator will strip all superfluous whitespace while preserving literal strings and escape nested quotes like
" 'foo' " or ' "foo" '
and problematic characters in a way that it doesn't break the button code.

You can click on the '>>' to view and select one of the available icons.

The buttonator builds the code as soon as you put the focus outside the input fields or switch to another field. You get 4 versions of the button code:
  1. Direct install code. Just click on the preview or drag and drop it to the toolbar of your liking, done.
  2. BB Code to set links in the most common forums (like the my.opera forums too)
  3. Normal Link code <a href etc. for normal webpages.
  4. A buttonator link if you want to provide the option to edit the button



You can either use the button generator from my private website online or you can save the HTML file and use it locally. Everything is contained in a single HTML file. smile

Print with Internet Explorer right from Opera

,

Printing in Opera, bØrked since 1997.

Exaggerated? Yes, but not much. Printing is one of weakest points of Opera - at least in Opera for Windows (no *x or M* here, sorry)

A member of the my.opera community asked me, if I could write an extension, that opens the Internet Explorer for printing web pages (yes, the Internet Explorer can indeed print websites) but I had to decline the request for two reasons:
I am not that good in writing extensions and, what is more important, extensions, as they are now, can't do that.

But Opera wouldn't be Opera without the nice hackish solution for (almost) all kinds of problems: Buttons.

... but there is another problem:
The Internet Explorer doesn't support a print command in it's command line, so the button needs some help from a little VBScript file.



Part one of the hack: The Button

The button will not work without the VBS file in the right place!
Print in IE <-click to install the the button and drag and drop it to the toolbar of your liking.

Button code in human readable form:
opera:/button/Execute Program,"iexplore","%u","Print in IE","Print Document"&Delay,2000&Execute Program,"ie_print_preview_v01.vbs"


Part two of the hack: The VBScript

Copy the following, paste it into Notepad or any other text editor of your choice and save it as
ie_print_preview_v01.vbs
in the "Windows" folder of your system. To do this, open the Explorer, type %windir% into the address bar and hit the enter key, or navigate to the windows folder by clicking. The folder is usually called C:\WINDOWS)

' VB Script Document
set WshShell = CreateObject("WScript.Shell")
WshShell.appactivate "iexplore"
WScript.Sleep 100
WshShell.SendKeys "%f"
WshShell.appactivate "iexplore"
WScript.Sleep 100
WshShell.SendKeys "v"

Parameters
  • "%f" stands for Alt+F (File) in the English version of the Internet Explorer, replace it by "%d" for Alt+D (Datei) in the German version or the appropriate letter that causes the same action in your system's language.
  • "v" works for the English and the German version, please change it to the correct letter for your system too.


How it works
Both parts work together by first opening the Internet Explorer with the web page, then waiting for 2s and then sending the keyboard shortcuts for print preview.

Modifications
If you want to save the VBS with a different name or need to modify the delay because your Internet Explorer starts too slow (someone told me that disabling Flash in IE helps wink) you need to modify the button too.

Here the buttOnator link for making your life easier smile
The "Delay" is in milliseconds, 1000ms = 1s
If you want to save the VBScript to another location or if you want to rename it, you must insert the whole path, e.g.:
D:\myhacksfolder\the_print_script.vbs
(do not change the .vbs file extension)

Thanks
to Unrealmirakulix for the question and a part of the VBS. smile


Some Opera Icons

,

I always had the problem to distinguish between the various Opera installs on my computer, so I decided to make some slightly cusomized icons I can use for shortcuts instead of the original icons.



The icons come in sizes from 16*16px up to 256*256px with color resolutions from 16 colors (does anyone still use that confused ) to true color.

Download: opera-icons.zip 877KB

In Windows:
  1. Unzip the zip to a folder where you can find again.
  2. Right-click on each opera.exe you want to start.
  3. Choose Send to Desktop or Create Shortcut.
  4. Right-click the new shortcut icon on the desktop.
  5. Select Properties > Change icon.
  6. Browse to Browse to the icon (.ico) file you want to use in the folder you created in step 1.

How to make an extension that does all of this?

, ,

1. The extension should do something with a webpage by the means of an injected script.

2. The injected script should start
  1. on click of a button
  2. on keyboard shortcut
  3. on mouse gesture (optional, if the user wants to set up a gesture)


3. The extension should have
  1. an options page for the more complicated settings
  2. a help page for all people who need to read up what some of the settings could mean
  3. a popup for live settings


4. The popup should
  1. not open on the normal click that starts the injected script
  2. be able to change some preferences


5. The preferences' changes in the popup should be
  1. applied to page without the need to reload the page.
  2. saved to the extension's preferences, as soon as the popup closes (or live, if possible).


6. The preferences set in the options page or the popup should be applied even when the extension's injected script is started by keyboard or mouse gesture.

Read more...

cleanPages mobile - very experimental

, , , ...

Lately Opera released a Opera Mobile labs version with extensions support and I was happy to see, that in principle the cleanPages extension works "out of the box" with this build.

... but there were some things that annoyed me: The first and most visual thing was, that the extensions button was blurry. OK, not a big thing but when I was on it, I noticed that there were some settings in the extension, that, while working fine when viewed on a desktop monitor or a decent sized tablet screen, make no sense on the small screen of a mobile phone.

I decided to give the cleanPages Alpha an overhaul, and here it is:

cleanPages Mobile 1.0.1 <- download from this blog for your mobile phone.

If you have an android device and feel curious, head over to the Labs page install the Opera 12 Mobile Labs version, give the extension a try and tell me if it works with your phone. If you use an Android based tablet instead of a phone, I would recommend using the desktop version which has better settings for wider displays. smile

Tap once on the extension's icon to start it, tap a second time to reload the original page.



Attention:
Very experimental, it may contain bugs, but AFAIK it will and can not not harm your mobile phone. wink

Saving a web page in it's actual state

, , ,

One of the main problems with all browsers is, that there seems to be no way to save a webpage in the state like it is after some Javascript modified it. While it is understandable that browsers don't do it to avoid the duplicate execution of Javascripts, it was quite annoying when I wanted to save a web page after applying the changes of the cleanPages extension.

AFAIK it is not possible to save pages directly from an extension (may be it is possible by base64 encoded data:url == overkill) but this doesn't mean that it is impossible to achieve. Opera has a stepchild that, despite it is getting no love from the UI developers, is quite powerful:
Buttons.

I have created a button that takes the modified source, opens the source view tab, replaces the original page code with the modified code, re-applies it to the web page so that it becomes part of the "real" source code and then opens the save dialog.

This way a modified page can be saved in the state after cleaning, either as HTML or as MHT file.

Here the code of the button for direct install:
gen Src save <- to install click here or drag this link to (almost) any toolbar you like.


Warning:
The Button needs Javascript to work.
If you use this button with a page that has not stripped it's Javascript, the scripts may execute again if you open the saved page, such applying their code twice, so use this button with care.
The button does does not save form inputs.

Human readable button code:
opera:/button/Activate Window,,,"gen Src save","Mail Compose HTML"
&Go to page,"javascript:(function () {
    dt = (document.doctype.name)?('\<\!doctype '+ document.doctype.name +((document.doctype.publicId)?(' PUBLIC \u0022'+ document.doctype.publicId +'\u0022'+((document.doctype.systemId)?('\n \u0022'+ document.doctype.systemId +'\u0022'):'')):'')+'>'):'';
    d = dt + '\n' + document.documentElement.outerHTML;
    d = d.replace(/(\<|\>)/g, function (m, subm, i, str) {
        switch (subm) {
        case '<':
            return '<';
        case '>':
            return '>';
        default:
        }
    });
    var x = document.createElement('textarea');
    x.value = d.replace(/(<|>)/gi, function (m, subm, i, str) {
        switch (subm) {
        case '<':
            return '<';
        case '>':
            return '>';
        default:
        }
    });
    x.id = 'grabdatafield';
    document.documentElement.appendChild(x);
    x.select();
    x.focus()
})();",1
&Delay,1000
&Copy
&Go to page,"javascript:document.getElementById('grabdatafield').parentNode.removeChild(document.getElementById('grabdatafield'));void(0);"
&View Document Source,""view""
&Delay,700
&Select All
&Paste
&Go To Start
&Focus Page
&Reload
&Switch To Previous Page
&Activate Window
&Save Document

Known issues:
The source view stays open. I still have not found a way to close that after the save dialog closes.

What happened end of 2009?

,

Something really mysterious happened in the end of 2009 - a whole bunch of old Opera supporters, good scripters, people with good hints and tricks vanished silently and several of them were never seen again.

Here a short and very incomplete list of blogs I used to read, which silently stopped posting new entries:

Lex1, MarcFou, tomu, shoust, scipio, AyushJ, bpm, FataL, (...)

I wonder if they are still among us (not meaning dead no), if they switched browsers, had something else to do?

crapDimmer

, ,

crapDimmer is a small one trick pony extension to dim down distracting content on web pages.

Install the extension, load a webpage with distracting content, select some text you want to read and click the button. crapDimmer makes all content transparent that doesn't belong to the element in which you started to draw the selection, thus the relevant content stands out for easier reading. Click the button again to revert the changes.

The extension comes without any warranty for fitness, it is just an experiment and I don't plan to submit it to the extensions catalog.

You can download it here from my blog: crapDimmer.oex v 1.0.3 (about 7.6KB).

If you like it, or if you can provide a line of code to improve the extension: Feel free to write a comment below smile