diff options
Diffstat (limited to 'crocoite/data/per-site')
-rw-r--r-- | crocoite/data/per-site/instagram.js | 21 | ||||
-rw-r--r-- | crocoite/data/per-site/twitter.js | 30 |
2 files changed, 0 insertions, 51 deletions
diff --git a/crocoite/data/per-site/instagram.js b/crocoite/data/per-site/instagram.js deleted file mode 100644 index da7b5ea..0000000 --- a/crocoite/data/per-site/instagram.js +++ /dev/null @@ -1,21 +0,0 @@ -/* 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); -}()); diff --git a/crocoite/data/per-site/twitter.js b/crocoite/data/per-site/twitter.js deleted file mode 100644 index 2773f64..0000000 --- a/crocoite/data/per-site/twitter.js +++ /dev/null @@ -1,30 +0,0 @@ -/* Fixups for twitter: - * - Some accounts are hidden behind a “suspicious activity” message, click - * that. - * - Click “more replies” buttons periodically (as they popup when scrolling) - */ -(function(){ -function makeClickEvent () { - return new MouseEvent('click', { - view: window, - bubbles: true, - cancelable: true - }); -} -function expandThread () { - let links = document.querySelectorAll('a.ThreadedConversation-moreRepliesLink'); - for (let i = 0; i < links.length; i++) { - links[i].dispatchEvent (makeClickEvent ()); - } - return true; -} -function showProfile () { - var show = document.querySelector ("button.ProfileWarningTimeline-button"); - if (show) { - show.dispatchEvent (makeClickEvent ()); - } -} -window.addEventListener("load", showProfile); -/* XXX: can we use a mutation observer instead? */ -window.setInterval (expandThread, 1000); -}()); |