Skip to content

Instantly share code, notes, and snippets.

@AFutureD
Last active May 22, 2023 07:40
Embed
What would you like to do?
A Tempermonkey script for Hypothes.is
// ==UserScript==
// @name Hypothesis
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author AFuture
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
window.hypothesisConfig = function() {
return { showHighlights: true, appType: 'bookmarklet' };
};
var d = document, s = d.createElement('script');
s.setAttribute('src', 'https://hypothes.is/embed.js');
d.body.appendChild(s)
var css = ""; css += [
"[class^=\"annotator-bucket-bar\"]{display:none;}"
].join("\n");
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
var heads = document.getElementsByTagName("head");
if (heads.length > 0) { heads[0].appendChild(node); }
else { document.documentElement.appendChild(node); }
})();
@vanbang9710
Copy link

Could you please change the file name to Hypothesis.user.js for easier integration to Tampermonkey?

@AFutureD
Copy link
Author

@vanbang9710 Hi, I'v changed the file name as you wish.

@tophee
Copy link

tophee commented May 22, 2023

I wonder whether there is any way of hiding the hypothesis sidebar (without deactivating the script), or perhaps moving the expand button ("<") to a different place?

Reason: in its default position at the top right corner, that button tends to cover site navigation or menu items. A floating button that can be positioned wherever it's not in the way would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment