This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-07-29 17:44:55

Sidharth
Scratcher
Registered: 2007-12-14
Posts: 100+

Experimental Viewer user-script

If you saw that bookmarklet about the experimental viewer I made and wasn't satisfied, then here's a more "automatic" version, in the form of an user-script.

It REPLACES the link with another link that opens a new tab, instead of a new window AUTOMATICALLY!

Source code (Javascript)

Code:

function aFuNcTiOn() {
    var url = document.location.href;
    if (url.substr(0, 32) === 'http://scratch.mit.edu/projects/') {
        var lio = url.substring(0, url.lastIndexOf('/')).lastIndexOf('/');
        var part = url.substr(lio);
        var linkS = document.getElementsByTagName('a');
        var coUnt = 0;
        for (coUnt = 1; coUnt <= linkS.length; coUnt++) {

            if (linkS[coUnt].innerHTML == "Experimental Viewer") {
                linkS[coUnt].onclick = "";
                linkS[coUnt].href = "http://scratch.mit.edu/experimental/viewproject" + part;
                linkS[coUnt].target = "_blank" + part;
            }

        }
    }
}
aFuNcTiOn();

If you already know how to install them on your browser, then download it here.



If not then here are two tutorials (Google Chrome and Firefox):

Google Chrome

Download the file and save somewhere. Then open up Google Chrome and the folder where you saved it and drag the file into Google Chrome. Then it's pretty self-explanatory.

Firefox

Download Greasemonkey here.

http://i.imgur.com/fYUBU.png

Then:

http://i.imgur.com/4VAOk.png

And then:

http://i.imgur.com/qMynW.png

Go here for final instructions.

---

If you didn't understand this, please reply and I will try to help you  big_smile

Last edited by Sidharth (2011-08-01 02:53:11)


http://www.danasoft.com/citysign.jpg

Offline

 

Board footer