Skip to content

Instantly share code, notes, and snippets.

@potter0815
Last active March 20, 2024 09:37
Show Gist options
  • Save potter0815/10ebf62d9c94fd58228cf0a3ef0b1615 to your computer and use it in GitHub Desktop.
Save potter0815/10ebf62d9c94fd58228cf0a3ef0b1615 to your computer and use it in GitHub Desktop.
Hypothes.is everywhere - Tampermonkey / greasemonkey script to enable Hypothes.is web client on all pages
// ==UserScript==
// @name Hypothes.is everywhere
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Enable Hypothesis scriptlet on all pages
// @author https://github.com/potter0815
// @match http://*/*
// @include http://*
// @include https://*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @license licensed under the MIT license; http://www.opensource.org/licenses/mit-license.php
// @run-at document-body
// ==/UserScript==
(function() {
'use strict';
var d=document,s=d.createElement('script');
s.setAttribute('src','https://hypothes.is/embed.js');
d.body.appendChild(s)
})();

Hypothes.is everywhere

Tampermonkey script to add the Hypothes.is web client to any Website

The Tampermonkey script adds the embedded webclient of Hypothes.is to any webpage, similar to the Bookmarklet. The main difference is that it is active by default and you do not need to click on the Bookmarklet.

This is espacially usefull for Firefox as there is no extension available.

Documentation

https://h.readthedocs.io/projects/client/en/latest/publishers/embedding/

<script src="https://hypothes.is/embed.js" async></script> 

Instalation / configutration

  1. Click on the RAW button next to "add-hypothesis-webclient-every-site.user.js" and the script should open in the tampermonkey editor.
  2. After installing the Hypothes.is script, the controls appear on the upper right of the Browserwindow, when loading a website 3. Now you can start annotating.
  3. Accesslists and blocklists for certain domains can be defined in the tampermonkey extensions settings.
  4. You can also fork the gist and install from there or copy the source and create a new script in the tampermonkey editor.

Compatibility

I've only tested the script with tampermonkey & Firefox on a Mac. The script should also work with Greasemonkey and other Browser / OS Versions.

Suggestions, bugs etc.

At GitHub

Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php

@krillin666
Copy link

Will this script work with ViolentMonkey ?

@diegodlh
Copy link

diegodlh commented Nov 8, 2022

Hi! There's a related guide available here: https://delahera.medium.com/hypothesis-web-annotation-mobile-358db1f9ec46. Also, there is an unofficial Firefox extension, but it has become a bit outdated: https://addons.mozilla.org/en-US/firefox/addon/unofficial-hypothesis/

@vanbang9710
Copy link

vanbang9710 commented Jan 18, 2023

@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