Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save saitamanodoruji/911469 to your computer and use it in GitHub Desktop.
Save saitamanodoruji/911469 to your computer and use it in GitHub Desktop.
Tumblr Dashboard Tab Open to Continue to Dig
// ==UserScript==
// @name Tumblr Dashboard Tab Open to Continue to Dig
// @namespace http://saitamanodoruji.tumblr.com/
// @description Press "c", and you can continue to dig dsbd in new tab.
// @include http://www.tumblr.com/dashboard*
// ==/UserScript==
(function() {
const KEY_TO_OPEN_TAB = 'c';
var boot = function() {
with (window.Minibuffer) {
addShortcutkey({
key: KEY_TO_OPEN_TAB,
description: 'TumblrDSBDTabOpenToContinue',
command: function() {
try { execute( 'TumblrDSBDTabOpenToContinue', execute('current-node')); } catch(e) { }
},
});
addCommand({
name: 'TumblrDSBDTabOpenToContinue',
command: function(stdin) {
try {
var url = execute('current-link').toString();
var postId = parseInt(url.match(/^http:\/\/[^\/]+\/post\/(\d+)/)[1]) + 1;
GM_openInTab('http://www.tumblr.com/dashboard/1/' + postId);
} catch (e) { }
},
});
}
}
if (window.Minibuffer) {
boot();
} else {
window.addEventListener('GM_MinibufferLoaded', boot, false);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment