Operaised -- The blog

Subscribe to RSS feed

Posts tagged with "UserJS"

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