From 8e939f8922815bd917f4dd750aa5f8a17a8f750c Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 19 Dec 2017 09:14:43 +0100 Subject: Select default behavior scripts by site URL --- crocoite/data/fixups.instagram.js | 21 --------------------- crocoite/data/fixups.twitter.js | 17 ----------------- crocoite/data/per-site/instagram.js | 21 +++++++++++++++++++++ crocoite/data/per-site/twitter.js | 17 +++++++++++++++++ 4 files changed, 38 insertions(+), 38 deletions(-) delete mode 100644 crocoite/data/fixups.instagram.js delete mode 100644 crocoite/data/fixups.twitter.js create mode 100644 crocoite/data/per-site/instagram.js create mode 100644 crocoite/data/per-site/twitter.js (limited to 'crocoite/data') diff --git a/crocoite/data/fixups.instagram.js b/crocoite/data/fixups.instagram.js deleted file mode 100644 index da7b5ea..0000000 --- a/crocoite/data/fixups.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/fixups.twitter.js b/crocoite/data/fixups.twitter.js deleted file mode 100644 index 330370a..0000000 --- a/crocoite/data/fixups.twitter.js +++ /dev/null @@ -1,17 +0,0 @@ -/* Fixups for twitter: Some accounts are hidden behind a “suspicious activity” - * message, click that. - */ -(function(){ -function fixup () { - var show = document.querySelector ("button.ProfileWarningTimeline-button"); - if (show) { - var click = new MouseEvent('click', { - view: window, - bubbles: true, - cancelable: true - }); - show.dispatchEvent (click); - } -} -window.addEventListener("load", fixup); -}()); diff --git a/crocoite/data/per-site/instagram.js b/crocoite/data/per-site/instagram.js new file mode 100644 index 0000000..da7b5ea --- /dev/null +++ b/crocoite/data/per-site/instagram.js @@ -0,0 +1,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); +}()); diff --git a/crocoite/data/per-site/twitter.js b/crocoite/data/per-site/twitter.js new file mode 100644 index 0000000..330370a --- /dev/null +++ b/crocoite/data/per-site/twitter.js @@ -0,0 +1,17 @@ +/* Fixups for twitter: Some accounts are hidden behind a “suspicious activity” + * message, click that. + */ +(function(){ +function fixup () { + var show = document.querySelector ("button.ProfileWarningTimeline-button"); + if (show) { + var click = new MouseEvent('click', { + view: window, + bubbles: true, + cancelable: true + }); + show.dispatchEvent (click); + } +} +window.addEventListener("load", fixup); +}()); -- cgit v1.2.3