Bookmarklets
Scihubify
.href = 'https://sci-hub.se/' + location.href location
Waybackify
.href = 'https://web.archive.org/web/*/' + location.href location
Record Meet Captions
Records the automatic captions generated by google meet into a new window.
function() {
(let title = "Captions for " + document.title
let win = window.open("", title, "width=780,height=200");
.document.head.innerHTML = "<title>" + title + "</title>";
win.document.body.innerText = "";
win
function isInfixOf(foo, foobar) {
return foobar.replace(foo, '') !== foobar;
}
// The class names are obfuscated. They'll probably change each time Meet is updated.
const CAPBOX_CLASS = 'TBMuR';
const CAPAREA_CLASS = 'a4cQT';
// Go up the chain looking for the caption containing the new span.
function findbox(nn) {
while (!isInfixOf(CAPBOX_CLASS, nn.className) && ('parentNode' in nn)) {
= nn.parentNode;
nn
}if (isInfixOf(CAPBOX_CLASS, nn.className)) {
return nn;
}return null;
}
let lastnode = null;
function callback_node(node) {
= findbox(node);
box if (box === null) {
return;
}if (lastnode !== null && box.innerText.toLowerCase().startsWith(lastnode.innerText.slice(0,20).toLowerCase())) {
// Update the last caption.
console.log('appending', box.innerText)
.innerText = box.innerText;
lastnodeelse {
} // Create a new caption item.
console.log('creating', box.innerText)
let newnode = win.document.createElement('div');
.innerText = box.innerText;
newnode.document.body.appendChild(newnode);
win= newnode;
lastnode
}
}
function callback(records) {
for (record of records) {
for (node of record.addedNodes) {
callback_node(node);
}
}
}
var observer = new MutationObserver(callback);
// Set a watch on the caption area.
var targetNode = document.body.getElementsByClassName(CAPAREA_CLASS)[0];
.observe(targetNode, { childList: true, subtree: true });
observer; })()
Enable Text Selection
Override evil web pages that abuse user-select: none
.
function() {
(= document.querySelector('body');
body = document.createElement('style');
st .innerText = '* { user-select: auto !important }';
st.appendChild(st);
body; })()
Kill Sticky
Pretty much redundant now that AlwaysKillSticky exists.
function() {
(var i, elements = document.querySelectorAll('body *');
for (i = 0; i < elements.length; i++) {
= getComputedStyle(elements[i]).position;
position if (position === 'fixed' || position === 'sticky') {
.parentNode.removeChild(elements[i]);
elements[i]
}
}; })()
Click to Remove
Toggle a mode that kills elements when you click on them.
function() {
(if (window._rm_md) {
document.onmousedown = window._rm_md;
window._rm_md = null;
else {
} window._rm_md = document.onmousedown || function() {};
document.onmousedown = function(e) {
= e || window.event;
e .target.parentNode.removeChild(e.target);
e;
}
}; })()