This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install https://github.com/jikamens/userChromeJS and save this as chrome/userChrome.js in your TB profile directory | |
window.addEventListener('keydown', function (event) { | |
if (event.metaKey && event.ctrlKey && event.key == 'o') { | |
var loadFirstURLInBody = function (body) { | |
var parser = new DOMParser(); | |
var doc = parser.parseFromString(body, "text/html"); | |
var links = doc.getElementsByTagName('a'); | |
if (links.length) { | |
let uri = Services.io.newURI(links[0].href, null, null); |