Skip navigation.

exploreopera

| Help

Sign up | Help

Block external userjs updated to version 2.5

Changelog:

1. Added setting to allow specific resources from off site that are most commonly used. Sites that use paypal buttons, imageshack/photobucket photos, or sites that use blogger resources etc.

2. Added setting to allow popular flash video to work on sites. Like youtube, dailymotion, revver and the like.

3. Removed setting that would add ?blockoff into the url, which would typically cause a reload.

4. Changed style a bit on the blocked placeholder and gave it a green dotted border.

In general, more things to the site unblocked, most things not to the site , blocked :smile:

blockexternal.js

Skinning tip -- Remove icons from toolbar when disabled.

, ,

Usually when the back button is disabled, you see the icon with its text greyed out.

However with this tweak you can make buttons disappear completely in images only mode on your toolbar, or no icon for images and text modes.

First up, open up skin.ini in any of the skins zip files.

This removes any padding or margin left or right, so there isn't any space.

[Toolbar Button Skin.disabled]
Padding Left= 0
Padding Right= 0
Margin Right= 0
Margin Left= 0


Create a seperate section for Back(for example that gets disabled when no back available)

[Back.disabled]
Width=0
Height=0


For the rest, clone the Back.disabled section and its done.

[Forward.disabled]
Clone = Back.disabled

[Stop.disabled]
Clone = Back.disabled

[Fast Forward.disabled]
Clone = Back.disabled

[Wand.disabled]
Clone = Back.disabled

[Trash.disabled]
Clone = Back.disabled



These will disable the icons for Forward, Stop, Fast Forward, Wand and Trash respectively.

Enjoy

Funny things

Searching for my name in google found this in urban dictionary.

http://www.urbandictionary.com/define.php?term=Simon+Houston

Probably fake though :smile:

Fix yahoo mail compose editor.

After a couple of hours trying to find out why yahoo mail compose editor didn't appear in opera, I decided to open up firefox and use the modify headers extension and find out.

Then I remember I can re-request a page using js using the XMLHttpRequest object and sending the user agent from that. Then as a result, document writing the final code. Maybe I can get this to work for hotmail as well, but maybe unlikely, we'll see about that though :wink: EDIT: Done with classic hotmail :up: at least on the live server anyway.

Its for the classic yahoo mail. There will be a delay, but the bar will appear.

Enjoy :smile:

classicyahoomailcomposefix.js

Bookmarklet to view forms properties and elements.

Here is a bookmarklet that lets you debug forms more accurately.

  javascript:
(function ()
{
  var s = "<title>Forms list</title><i>No action attribute usually means its pointing to the page's url and that something else is submitting the form</i>";
  var f = document.forms;
  for (var i = 0;i < f.length, t = f[i];i++)
    {
      var g = "";
      g += "<fieldset><legend>Form: " + i + "</legend>";
      for (var z = 0;z < t.attributes.length, x = t.attributes[z];z++)
        {
          a = x.name.toLowerCase();
          a = a.substr(0, 1).toUpperCase() + a.substr(1);
          if (g.indexOf(a + ": " + x.value) == - 1)
            g += x.value != "" ? a + ": " + x.value + "<br/>" : "";
        }
      for (var ty = 0;ty < t.elements.length, yu = t.elements[ty];ty++)
        {
          fg = yu.tagName.toLowerCase();
          fg = fg.substr(0, 1).toUpperCase() + fg.substr(1);
          g += "<fieldset><legend>" + fg + ": " + ty + "</legend>";
          for (var mx = 0;mx < yu.attributes.length, my = yu.attributes[mx];mx++)
            {
              hg = my.name.toLowerCase();
              hg = hg.substr(0, 1).toUpperCase() + hg.substr(1);
              g += my.value != "" ? hg + ": " + my.value + "<br/>" : "";
            }
          g += "</fieldset>";
        }
      g += "</fieldset>";
      s += g;
    }
  var y = window.open();
  y.document.write(s);
  y.document.close();
}
)();


It shows the all elements inside a form and the attributes attached to those including the attributes of the form itself.
Hope this helps out with form debugging on difficult pages.
UPDATE: Updated layout a little.

More on VBScript

There's ways to execute visual basic scripts without the need of saving a vbscript to a file.

However use this with extreme caution, as pages redirecting to .vbs scripts can be directly run too...

button

Heres the code in the data uri.

DIM Wsh
Set Wsh = WScript.CreateObject("WScript.Shell")
Wsh.SendKeys "^s{TAB}{DOWN}{DOWN}{DOWN}{ENTER}+{TAB}"
Set Wsh = nothing
WScript.Quit


This is a custom button which defaults to "save as web archive".

However it won't work at first go.

So first, drag the button to a toolbar, and click on it, then a download dialog will appear.

Then click "Change.." , enter "vbs"(without quotes) in the "File Extensions" field, then click radio button "Open with default application" then click "OK". Next time you click the button it will open the "Save as" dialog with default dropdown to "Web archive (single file)".

Either use this at extreme caution, or save this file below(right click > Save target as, if you have already set the above, and save it somewhere)
saveasarchive.vbs

Then use this code.

Execute program,"path/to/where/you/saved/saveasarchive.vbs",,"Save","Save document"


Replace the "path/to/where/you/saved/" with the direct path to your vbs file.
And input it into a button maker.

http://nontroppo.org/tools/buttonmaker/ , enter the code into the "OR just write the action as plain text:" field and click "Create button".

And you're done.

My Top 5 wishes for Opera.

, ,

As tagged by olli, it's my turn to post my top 5 wishes for opera.

  1. Opera developer tools as sidebar/panel -- To the contrary, Opera's dev console is alright, but obviously there are some features missing.Mainly things like script debugging, and not being able to keep it working for the active tab. I hope Kestrel has the Developer tools as a sidebar (hopefully an editable one, so things like pagerank etc can be implemented without any fuss.)
  2. To make Opera's customizations more "modular" than it already is -- Having something like this would allow opera to build a more extension like format that'd compete with firefox.
  3. Auto-update manager for opera and its plugins. -- This is a must for usability, first of all, it'd be easier to upgrade, it could reduce server load on Opera server if they were patches. And plugins would be more easier to handle and install.
  4. Inline spell checking -- This would make it easier to spell check documents etc than the current solution which is right click "check spelling" which takes more time plus in windows and linux at least you need to download and install a spell checker library.
  5. Allow small transparent html buttons on toolbars -- Things like pagerank would be implementable in a toolbar if combined with userjs to have pagerank and other features.


Other things which are probably not too important to me..

[*] Allow right click in special menu's like bookmarks and addresses in menus -- This should improve bookmark usability which the other browsers already have.

[*] Add more familiar buttons to a section in the buttons tab called "Common buttons" so newbies to opera can find their familiar buttons of other browsers quickly and easily.

[*] Make Set Preference command faster-- as it can be really slow with a load of tabs open or lots of widgets in cache.

Who have I to tag? Here's who I'm tagging.

Johnnysaucepn
Coxy
operafan2006
Haavard K. Moen
Hallvord R. M. Steen

My userjs/modified userjs

Here are some of My User Scripts I've been making/modifying over a couple of years. Enjoy

My Scripts

betfair-com-menu-fix.js -- Tries to fix the menu on betfair website. Makes it usable at least.

cookieblockrBETA.js
-- Attempts to delete useless cookies using javascript. Check file for list of possibly useless names.

uploadmoc.js
-- (For my opera forums and blogs)Script that auto attaches the code to the post when you upload when there is only one file to attach, when you have multiple options, clicking one will automatically put it into the post.

googleads.js

-- Script to have ads in Opera almost like the old times when Opera had google ads.

showiconsaslinks.js

-- Don't like the annoying widget/feed icons in your address field? This script removes it. And optionally puts them on the webpage as links instead.

pdfdownload.js

-- A script to intervene loading of a pdf document in browser and allows an option to render it using google, or letting you "save target as" with the link. Or allow the rendering in browser.


imageinfo.js

-- A script to emulate how firefox shows its image details on a tab (eg filename.extension width'x'height' pixels'), might not work everytime though.

cachejsurls.js

-- When a bookmarklet is run, Opera will ask you to cache it to window.name , in laymans terms, store the code to the tab until closed, and all code that is stored will be run onload.

bgimage.js

-- Allows you to get the background image from document.body of the page. When installed, just right click on a page and you should get a background submenu.

blockscripts.js

-- Allows you to block javascript on the site but allow userjs on the page. Ctrl Alt and click allows javascript on for that tab so it can still work.

mediafix.js

-- Script to fix some wmp sites who forget to update the embed bit with the same filename parameter, seems to happen quite often like here( http://www.radioboanova.com.br/rbn_online1.htm )

lastfmblack.js

-- Script for lastfm to set black style as the default "skin".

autorapidshare.js

-- Script to automate some of rapidshare, which clicks the "Free" button, notifies you to focus the capatcha, then auto-downloads file when fourth character of capatcha code is entered.

setaccesskeysforsubmit.js

-- Script to attach accesskey s for submit forms, so pressing shift esc then s will submit a form, usually the first form though.

removetooltips.js

-- Script to remove url tooltips from the page, useful when you want to see content on the page. You can enter the hosts for the script to run on or the exact urls to run on, by seperating each by spaces.

lowquality.js

-- Script that makes all flash to be set to low quality, meaning hopefully it spares a few cpu cycles.

Modified Versions of Other Scripts

autosizer2-0.js

-- Allows one click fitting to window width/height,maximize or original. Original script couldn't detect all types of images so I made this version that does. Original script here.

blockexternal.js

Script to block external resources of a site, the problem with the original script is that it tended to misfire way too much, this version of the script blocks less than the original as I've made it so subdomains etc are supported too. Original script here.

Use Wii's internet channel zoom point in Opera.

Assign a mouse gesture to "Zoom point,50" (or 100 depending on how far you want to zoom).

Place mouse cursor on the area you want to zoom into. And perform the gesture!

Sure there isn't any fancy effect to this zoom but it works pretty much like wii's internet channel zoom!

Putting those spare mouse buttons to use(and then some..)

Apart from the right and left click buttons on the mouse, the other buttons on your mouse are probably the most neglected buttons in Opera, maybe all they were designed to do is back and forward.

Not so fast there, my friend, because as you can edit those mouse buttons and their actions, and even so in parts of opera where the shortcut wouldn't normally apply.

First of all, to start editing or making your own mouse shortcuts, go to Tools > Preferences > Advanced > Shortcuts and click "Edit" button near selected mouse setup.

What you should see is a list of places where the shortcut can be used in.
-Application
-Browser Window
-Mail Window
-Document Window

And so on, until Advanced section at the bottom, with even more places to put in shortcuts.

Here is a key of the button numbers:

Button3 // Middle mouse button
Button6 // Special back button on some mice.
Button7 // Special forward button on some mice.
FlipBack // Its a special "rocker" gesture, where 2 buttons are hit simultaneously, but for this one, the right click is held before the left click.
FlipForward // Same as above, but this one, the left click is held before the right click.


And the list of known about sections.
Application // Section that overrides all the other sections! Only put shortcuts in here that you are guaranteed not to use anywhere else in Opera.
Browser Window // Section that only resides to the browsing window, so in theory should not activate in opera's email compose window for instance.
Mail Window // Section that applies to the mail interface, for example the mail listing window, or the email compose window.
Document Window // I think this section is roughly the same as Browser window, post in comments if there is any difference between the two.
Compose Window // This section should only apply to the email compose window.
Bookmarks/Contacts/History/Mail/Transfers/Windows/Notes panel // Sections that the shortcut is in would only apply to the retrospective sidebars.


Whats known in the advanced section:

Dialog // Section where the shortcuts would only apply to the dialogs, like the preferences dialog for example.
Form // I'm guessing this would work in html forms.
Widget Container // These are the toolbars and their contents. Not specific to a toolbar though, to all.
Browser/Bookmarks/Contacts/Notes Widget // sections inside the retrospective areas. 
Button Widget // For buttons, obviously, on the page I think.
Radiobutton/Checkbox/Dropdown/List/Tree Widget // Has the affect on html elements that are those maybe in Opera UI this has an affect too.
Edit Widget // Literally anywhere you can enter text.
Address Dropdown Widget // The address field specifically.


For example you could put a "Paste and Go | Paste" command with the "Button3" as button, and clicking that would either paste and go in address bar and search fields inside opera, or paste into a text field on the page.

Experiment and have fun!

Combining VBScript, Opera and Javascript for effective functions.

, , ,

Although VBScript is seemed to be a language only windows users can use, it can come in useful when automating commands in Opera can be a pain.

DIM Wsh,ArgObj,var1
Set ArgObj = WScript.Arguments
Set Wsh = WScript.CreateObject("WScript.Shell")
var1 = ArgObj(0) 
if var1 = "source" then
Do Until Wsh.AppActivate ("Selection source for")
WScript.Sleep 500
Loop
Wsh.SendKeys "^a"
Wsh.SendKeys "^c"
Wsh.SendKeys "^{F4}"
else 
Do Until Wsh.AppActivate ("Links Selected for")
WScript.Sleep 500
Loop
Wsh.SendKeys "^a"
Wsh.SendKeys "^c"
Wsh.SendKeys "^{F4}"
end if
Set Wsh = nothing
WScript.Quit


Here is example code of a VBScript,save this as copy.vbs and save it in your main program files > opera folder, what the script does is it looks for the active window title, then sends the key commands to copy the content and close the tab creating the content. One is for the selection source bookmarklet which is found here: http://my.opera.com/community/forums/topic.dml?id=140523

Here is an example to put in menu.ini file to run the VBScript first then run the javascript code.

Item, "Copy selected links/All links" = Execute Program, "copy.vbs","selectlinks" & Go to page, "javascript:(function(){ var html_selection=document.createElement('div'); var yay=[];  if(document.getSelection()){ html_selection.appendChild(window.getSelection().getRangeAt(0).cloneContents()); } if(!html_selection.getElementsByTagName('a')[0]) { document.designMode='on';document.execCommand('selectall', false, null);html_selection.appendChild(window.getSelection().getRangeAt(0).cloneContents());document.links[0].focus();document.designMode='off'; } var hmm=html_selection.getElementsByTagName('a'); for(var i=0;i<hmm.length;i++) {yay[i]=hmm[i].href};var ty=window.open();ty.document.write('<title>Links Selected for '+location.href+'</title>'+yay.toString().replace(/\,/g,'
'));ty.document.close();})(); "


This javascript function copies selected links to the clipboard, or copies all links of the page if no selection or the selection contains no links.

These are just examples of how VBScript can help Windows Opera users extend Opera's functionalities a tiny bit more :smile:

Sidebar Inspecting

, , , ...

From an earlier blog post, I've managed to enhance the example on cross document messaging, where as to the point I have made it so you can inspect an object and view its attributes assigned to it.

First of all, make this page into a sidebar/panel.
http://h1.ripway.com/shoust/sendmsg.html

And install this userjs.

http://h1.ripway.com/shoust/UserJS/sendmessage.js

How to install scripts here

Then when done, load the page and insert the address into the text field, and select either of the three options(source,dom and resources).

What the source option does is post the url's source to the textarea when loaded and closes the page that was opened. Resources does the same except you get a list of external/internal resources used on that page as links below the textarea.

The Dom option however does not grab the sourcecode of the targer page or close the target page. First it loads the page and adds a mousemove event, and sends the tagname of the element mouseovered, plus the attributes that it has.(To stop the inspecting, just tap ctrl key, to start again, hit ctrl key again)



What do you think? :smile:


Enable a sort of caret navigation for opera 9.

, ,

Assign this to the k ctrl shortcut in opera, to turn it off, press k ctrl again.

Focus page & Go to page,"javascript:if(document.designMode=='on'){void(document.designMode='off');}else{void(document.designMode='on');}"


Needs javascript to be enabled of course.

Some opera 9 logostuff

Enjoy P:



Look into those eyes!!!

With all the acid2 buzz coming to an end with Opera 9, I'd thought I'd copy and paste the eyes with the keyboard shortcut in designMode.

Highlight Bookmarklet for 9.

javascript:document.designMode='on';  document.execCommand('hilitecolor', false, 'yellow');document.execCommand('forecolor', false,'black');document.designMode='off';void (0)


Make this a bookmark and click it when you need it, in 9.
To highlight selected text in 9 :smile:
Enjoy :smile:

Creating a bar(using userjs) for opera

, ,

Opera doesn't have the abilty to create third party toolbars in a sense of grabbing variables and putting them inside its own UI, here is a short tutorial in how to create your own 'toolbar' using the power of UserJS.

First of all, define a variable to the bar that is created.
For example;

var toolbar = document.createElement('div');


Then add a style to the bar you have made, make sure positioning and height/width is defined and imo its better to have it like this:

toolbar.style='position:fixed;top:0;background-color:white;border:1px dotted black;';


And for reference, its best to add an id to the bar as reference for later.

toolbar.id='newbarw00t';


And to add the html content, use innerHTML. Like this:

toolbar.innerHTML='< a href="http://my.opera.com">opera community site</ a>';


And finally, append the bar to the page!

Don't use document.body as that takes in account the current pages style. Use document.documentElement instead; like this.

document.documentElement.appendChild(toolbar);




Source panel(sort of)

, , ,

Using a bit of Cross document messaging its possible to comminucate between different documents, using the power of UserJS I made a sort of source panel :smile: .

http://h1.ripway.com/shoust/UserJS/sendmessage.js

http://dhost.info/shoust/sendmsg.html

With the html page, all you do is type in an address, and upon pressing Go, opera will open the page, and when the document fully loads, the pages source is viewed inside the html page, It works inside the panel too.. so the best bet is to bookmark the html page or save it, install the userjs file, and instruct the html page to open a site you want the source from and voila.. thats it :smile: When the source is grabbed. The window opened will be closed :smile: Thats all there is to it.

EDIT: For all those trying it out, it is b0rked currently in 9p1, :smile: works in 8 and above i think :smile:

New Flashblock.css with extra features.

It blocks flash, iframes until clicked, also when shift is pressed when you hover over an img/inactive flash/inactive iframe, it allows it to be opened in a new window.

Enjoy :smile:

http://h1.ripway.com/shoust/blockopen.css

Edit: Now applied for java applets.

Distinguishing between opening new windows on a page and where ever else.

When navigating around Opera and you want to be able to do a supersearch for example, using the recent javascript options, its been impossible to remove the empty page with the javascript: uri inside it. Here's ways of how to disable it at any cost.

1. Always void when opening a new window. This way doesnt allow the original page to be overwritten. Example below:

 javascript:void(window.open('about:blank')) 


Which opens about:blank in a new window. and the original web page stays intact.

2. Use an if function to check if the window's location protocol opened is javascript: and target the self or open a new window accordingly.

 javascript:if(location.protocol=='javascript:'){alert('Opening page on javascript protocol');window.self.location='about:blank';}else{alert('Opening in new window');window.open('about:blank')} 


3. Use same method of checking for javascript: protocol in 2, but instead of setting a window.self.location, use window.close() instead.

 javascript:if(location.protocol=='javascript:'){window.open('about:blank');window.open('about:blank');window.open('about:blank');window.close();}else{void(window.open('about:blank'));void(window.open('about:blank'));void(window.open('about:blank'));} 


That should help in the steps of making a supersearch or simalar method of opening windows without the useless blank page. :smile: