Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

easier bookmarklet development

Here's how I make develop a bookmarklet: I write a javascript function, pass that to Bookmarklet Builder to make a bookmarklet, add the bookmarklet to my browser, load my test webpage, test the bookmarklet, and then something doesn't work, so I try to find what's wrong and change my javascript function accordingly and the tedious cycle starts again.

How can I make this cycle less tedious?

like image 726
Yoo Avatar asked Nov 27 '09 22:11

Yoo


People also ask

What is a bookmarklet used for?

The Most Useful Bookmarklets to Enhance Your Browsing Experience. Bookmarklets are JavaScript links you can place on your browser’s toolbar that add one-click functionality to the browser or webpage. They are free and help make repetitive tasks in your browser quicker and easier to perform.

How do I make a self-updating bookmarklet?

If your bookmarklet makes use of a front end, you're free to pull in the HTML and CSS externally as well, making your bookmarklet truly self updating. Again, if you're building a behemoth of a bookmarklet, you may have need for one of those JavaScript libraries.

What kind of bookmarks will we be building?

We'll be building one that submits to Reddit. Ones that obtain information and/or modify the current page. We'll be building a bookmarklet that sets a page's background color. Ones that works behind the scenes. A bookmarklet that erases any cookies of the current site is a prime example and one that we'll be building.

What are the best bookmarklets to use on Reddit?

The Reddit Bookmarklet makes it easier for redditors to not only submit interesting Web sites, but cast “like” or “dislike” votes for sites that have already been submitted. There’s also a “Serendipity” bookmarklet that’ll take you to a random site through Reddit. You can get it here. 7. Google Translate Bookmarklet


1 Answers

These days I prefer to edit a file on my webserver, then load that using a bookmarklet. For example:

javascript:(function(){
    var newScript = document.createElement('script');
    newScript.src = 'http://hwi.ath.cx/javascript/wordcloud.js?dummy='
                     + Math.random();
    document.body.appendChild(newScript);
})();

The random parameter is useful for a script under development, to ensure the browser won't load an older version from its cache.

I find development with a text editor far preferable to the console, because I can take advantage of syntax highlighting, shortcut keys, and — you know — newlines.

like image 190
joeytwiddle Avatar answered Sep 19 '22 06:09

joeytwiddle