From a technical point of view, bookmarklets are small portions of JavaScript code that extend Internet Explorer's functionality. In essence they are a special kind of favourite, with a given action applied to the currently opened page.
To create a bookmarklet favourite in Internet Explorer on Windows Phone 8 create a new favourite from any page and then edit the name and web address fields as needed.
Putting a hyphen (-) in front of the favourite's name means that it will show up at the top of your favourites list. If you prefer, you can use a full stop, brackets, or another symbol. Alternatively, you could preface the name with a "z", in which case the bookmarklets will be at the bottom of your favourites list.
Navigation shortcut bookmarklets
Forward
In the move from Windows Phone 7 to Windows Phone 8, Microsoft removed the "forward" navigation option from Internet Explorer's menu. The equivalent functionality is available via the "recent" (history) option in the main menu, but as an alternative you can create a "forward" shortcut favourite to move one page fowards in your browsing history.
- Name: - Forward
- Web address: javascript:history.forward()
Back
The same technique can be used to create a "back" shortcut favourite. Given the presence of the standard back key on all Windows Phone devices this is less useful than the "forward" shortcut. However, it can still be useful when switching back to Internet Explorer after using another app (i.e. multi-tasking), since Windows Phone's back key follows your path through the phone, not your web browsing history (i.e. in the multi-tasking scenario, the back key will take you back to the previous app, not the previous web page).
- Name: - Back (or equivalent)
- Web address: javascript:history.back()
Top
Also useful is the "top" shortcut, which returns the browser view-port to the top of the page (i.e. automatically scrolls to the top of the page instantly). This can be handy when reading a long page, such as a Wikipedia entry or reference article.
- Name: - Top (or equivalent)
- Web address: javascript:scroll(0,0)
Other bookmarklets
The bookmarlets detailed above are very simple. While Internet Explorer on Windows Phone 8's support for bookmarklets is somewhat limited, it is possible to automate some very useful additional actions and functionality.
Title
The "title" bookmark is an example of how you can get information about the current webpage. It shows the title of the current web page, taken from the page's <title> tag. It's possible to use this to show other page attributes too (e.g. document.URL):
- Name: - Title
- Web address: javascript:alert("Title:"+document.title);
Readability
The "readability" bookmarklet sends the current page to Readability, a service that turns any web page into a reading optimised view. It's particularly useful for reading content of pages that are poorly optimised for mobile, or that have been incorrectly rendered by Internet Explorer. Once the page has been processed, you can use Readbility's built in toolbar to change how the text is shown (size, background colour, font).
- Name: - Readability
- Web address: javascript:(%0A%28function%28%29%7Bwindow.baseUrl%3D%27//www.readability.com%27%3Bwindow.readabilityToken%3D%27%27%3Bvar%20s%3Ddocument.createElement%28%27script%27%29%3Bs.setAttribute%28%27type%27%2C%27text/javascript%27%29%3Bs.setAttribute%28%27charset%27%2C%27UTF-8%27%29%3Bs.setAttribute%28%27src%27%2CbaseUrl%2B%27/bookmarklet/read.js%27%29%3Bdocument.documentElement.appendChild%28s%29%3B%7D%29%28%29)
For a longer bookmarklet like this we recommend you copy and paste the web address portion, rather than typing it in manually. You can copy it from this web page, or you can email yourself the code and copy and paste it from there.
Translate
The "translate" bookmarket uses the Microsoft Translator service to translate the text of a web page into a language of your choice. The text will be translated in place (i.e. the text will be changed to English, but other page elements are left in place).
- Name: - Translate
- Web address: javascript:(function(){var s = document.createElement('script'); s.type = 'text/javascript'; s.src = 'http://labs.microsofttranslator.com/bookmarklet/default.aspx?f=js&to=en'; document.body.insertBefore(s, document.body.firstChild);})()
The code above is for translating into English (the source language is recognised automatically), but you can also use it with various other languages (or replace the "en" with your own language code, such as "fi" for Finnish).
and more...
There are plenty of bookmarklets floating around the web, but you'll find a lot of them do not work with Internet Explorer on Windows Phone 8 (e.g. those requiring additional input and/or something on the page to be highlighted). If you do find something that works, or have created your own bookmarklet then please share it in the comments.
Update
As pointed out by
- Name: - Refresh (or equivalent)
- Web address: javascript:window.location.reload()