Learn the Power of a JavaScript Bookmark in Firefox

Learn the Power of a JavaScript Bookmark in Firefox
Page content

About JavaScript Bookmarks

Firefox gives users the ability to save JavaScripts as bookmarklets that perform actions within the Firefox environment. This

functionality gives users the powerful ability to easily perform repetitive or complex tasks with just a click of the mouse. The addition of a JavaScript bookmark in Firefox can massively expand the capabilities of the Firefox browser, adding an almost unlimited range of new actions.

Users can perform searches, extract texts, resize windows, access URL shorteners, reformat pages, and even send e-mails using JavaScripts saved as bookmarks inside a Web browser. In these cases, bookmarks inside Firefox act in a way similar to desktop shortcuts in Windows.

Although JavaScript bookmarks will work in most browsers, this tutorial only discusses their use in Firefox. Here, we will review information about creating JavaScripts for use as bookmarklets, finding pre-fabricated bookmarks, and a step-by-step process for adding a JavaScript bookmark to the Firefox browser.

Image Credit: Wikimedia Commons/Perhelion

Creating a JavaScript Bookmark

Users interested in creating a JavaScript bookmarklet need to have a working knowledge of JavaScript. For those willing to learn, a good tutorial can be found online here or by searching Google, Bing, or Yahoo.

Those who are interested in the concept of JavaScript bookmarks in Firefox, but don’t wish to learn how to create JavaScripts, can find solace in the fact that hundreds of websites online have libraries full of scripts that users can bookmark and use inside their Firefox web browsers.

Although Firefox is supposedly designed to contain the behavior of scripts, users probably will still benefit by approaching any active scripts online with caution. This means that only scripts on sites that are reputable should be trusted.

One more thing: for JavaScript bookmarks to work, JavaScript processing must be enabled in a user’s browser.

The following procedure shows users how to add a bookmarklet to Firefox.

Using JavaScript Bookmarks in Firefox

JavaScript bookmarks can be found online at websites such as Mozilla Links and others. At these sites, users can find the JavaScript bookmarks they like and then add them to the Firefox browser on their computer.

JavaBkMk001

To demonstrate how this works, suppose that users want to try the “Send Selected Text and Link with Gmail” JavaScript bookmark shown below.

JavaBkMk002

Users only have to right click on the link and then choose the “Bookmark This Link” option from the context menu.

JavaBkMk003

When the “New Bookmark” window opens, users can then name their JavaScript bookmark, add tags, and click the “Save” button as if it were any other bookmark.

JavaBkMk004

Now, users can select some text and then choose the JavaScript bookmark from the bookmarks menu in Firefox as shown below.

JavaBkMk005

The JavaScript action will open Gmail and paste the selected text and add the URL to a new messages. Users can then modify the message, select recipients, and send it when ready.

JavaBkMk006

References

“Mozilla Links”,https://mozillalinks.org/wp/resources/bookmarklets-collection/

“JavaScript bookmarklets”,https://strangej.detrave.net/jb/

Screenshots by author