This bookmarklet toggles between HackerNews pages and Cheeuan's HackerWeb interface. If you're not on either then it acts a a bookmark to HackerWeb.
If you edit this, use something like bookmarkleter to convert it into a bookmarklet.
if ( /https?:\/\/news\.ycombinator\.com\/item\?id=(\d+)/.test(location) ) {
location = 'http://cheeaun.github.io/hackerweb/#/item/' + RegExp.$1;
}
else if ( /http:\/\/cheeaun\.github\.io\/hackerweb\/#\/item\/(\d+)/.test(location) ) {
location = 'https://news.ycombinator.com/item?id=' + RegExp.$1;
}
else {
location = 'http://cheeaun.github.io/hackerweb/';
}
Create a bookmark to HackerNews then edit it and paste the following into the URL/address field:
javascript:(function(){if(/https%3F:\/\/news\.ycombinator\.com\/item\%3Fid=(\d+)/.test(location)){location='http://cheeaun.github.io/hackerweb/%23/item/'+RegExp.$1;}else%20if(/http:\/\/cheeaun\.github\.io\/hackerweb\/%23\/item\/(\d+)/.test(location)){location='https://news.ycombinator.com/item%3Fid='+RegExp.$1;}else{location='http://cheeaun.github.io/hackerweb/';}})();
Domain has changed from http://cheeaun.github.io/hackerweb/ to https://app.hackerwebapp.com. To avoid the redirect the bookmarklet should be: