blob: da7b5ea2f49d2bae302643823807b35a17373ffb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/* Fixups for instagram: searches for the “show more” button and clicks it
*/
(function(){
function fixup () {
var links = document.querySelectorAll ("main a");
for (var i = 0; i < links.length; i++) {
var href = links[i].getAttribute ("href");
if (href.search (/\?max_id=\d+$/) != -1) {
var click = new MouseEvent('click', {
view: window,
bubbles: true,
cancelable: true
});
console.log ('clicking', href);
links[i].dispatchEvent (click);
break;
}
}
}
window.addEventListener("load", fixup);
}());
|