about summary refs log tree commit diff stats
path: root/assets
diff options
context:
space:
mode:
authorSimonBrazell <simon@brazell.com.au>2020-07-12 11:26:48 +1000
committerSimonBrazell <simon@brazell.com.au>2020-07-12 20:25:31 +1000
commit745c5babcf9104924631185b2ea3f235c45d270a (patch)
tree457df4cd62a541e1b65a82eb1ca2f9b1f28fbd06 /assets
parentCloses #64, closes #38 - Fix whitelist & Twitter `/home` exception (diff)
downloadlibredirect-745c5babcf9104924631185b2ea3f235c45d270a.zip
Improve exceptions (whitelist), i18n (fr), etc.
- Closes #69
- Closes #70
- Fixes #71
- Closes #72 - added fr l10n
- Fixes #73
- Implement additional Invidious params (#66)
Diffstat (limited to 'assets')
-rw-r--r--assets/images/Screen Shot Chrome 1.pngbin0 -> 495422 bytes
-rw-r--r--assets/images/Screen Shot Chrome 2.pngbin0 -> 882289 bytes
-rw-r--r--assets/images/Screen Shot Chrome 3.pngbin0 -> 313416 bytes
-rw-r--r--assets/images/Screen Shot Chrome 4.pngbin0 -> 1264130 bytes
-rw-r--r--assets/images/Screen Shot Chrome 5.pngbin0 -> 320255 bytes
-rw-r--r--assets/images/Screen Shot FF 1.pngbin0 -> 696755 bytes
-rw-r--r--assets/images/Screen Shot FF 2.pngbin0 -> 3036251 bytes
-rw-r--r--assets/images/Screen Shot FF 3.pngbin0 -> 530328 bytes
-rw-r--r--assets/images/Screen Shot FF 4.pngbin0 -> 3646768 bytes
-rw-r--r--assets/images/Screen Shot FF 5.pngbin0 -> 542853 bytes
-rw-r--r--assets/images/amo-badge.pngbin0 -> 2827 bytes
-rw-r--r--assets/images/buy-me-a-coffee.pngbin0 -> 5008 bytes
-rw-r--r--assets/images/chevron-down.svg3
-rw-r--r--assets/images/chrome-badge.pngbin0 -> 3762 bytes
-rw-r--r--assets/images/icon128.pngbin0 -> 3197 bytes
-rw-r--r--assets/images/icon16.pngbin0 -> 976 bytes
-rw-r--r--assets/images/icon32.pngbin0 -> 1983 bytes
-rw-r--r--assets/images/icon48.pngbin0 -> 1063 bytes
-rw-r--r--assets/images/logo-small.pngbin0 -> 22050 bytes
-rw-r--r--assets/images/logo.pngbin0 -> 39876 bytes
-rw-r--r--assets/images/small-tile.pngbin0 -> 35583 bytes
-rw-r--r--assets/javascript/localise.js19
-rw-r--r--assets/javascript/persist-invidious-prefs.js (renamed from assets/persist-invidious-prefs.js)0
-rw-r--r--assets/javascript/remove-twitter-sw.js (renamed from assets/remove-twitter-sw.js)20
24 files changed, 35 insertions, 7 deletions
diff --git a/assets/images/Screen Shot Chrome 1.png b/assets/images/Screen Shot Chrome 1.png
new file mode 100644
index 00000000..65e18e2a
--- /dev/null
+++ b/assets/images/Screen Shot Chrome 1.png
Binary files differdiff --git a/assets/images/Screen Shot Chrome 2.png b/assets/images/Screen Shot Chrome 2.png
new file mode 100644
index 00000000..7bb98a4a
--- /dev/null
+++ b/assets/images/Screen Shot Chrome 2.png
Binary files differdiff --git a/assets/images/Screen Shot Chrome 3.png b/assets/images/Screen Shot Chrome 3.png
new file mode 100644
index 00000000..3a4fbd35
--- /dev/null
+++ b/assets/images/Screen Shot Chrome 3.png
Binary files differdiff --git a/assets/images/Screen Shot Chrome 4.png b/assets/images/Screen Shot Chrome 4.png
new file mode 100644
index 00000000..8954e923
--- /dev/null
+++ b/assets/images/Screen Shot Chrome 4.png
Binary files differdiff --git a/assets/images/Screen Shot Chrome 5.png b/assets/images/Screen Shot Chrome 5.png
new file mode 100644
index 00000000..bf0ffa08
--- /dev/null
+++ b/assets/images/Screen Shot Chrome 5.png
Binary files differdiff --git a/assets/images/Screen Shot FF 1.png b/assets/images/Screen Shot FF 1.png
new file mode 100644
index 00000000..e4be8989
--- /dev/null
+++ b/assets/images/Screen Shot FF 1.png
Binary files differdiff --git a/assets/images/Screen Shot FF 2.png b/assets/images/Screen Shot FF 2.png
new file mode 100644
index 00000000..018789a3
--- /dev/null
+++ b/assets/images/Screen Shot FF 2.png
Binary files differdiff --git a/assets/images/Screen Shot FF 3.png b/assets/images/Screen Shot FF 3.png
new file mode 100644
index 00000000..90d28bda
--- /dev/null
+++ b/assets/images/Screen Shot FF 3.png
Binary files differdiff --git a/assets/images/Screen Shot FF 4.png b/assets/images/Screen Shot FF 4.png
new file mode 100644
index 00000000..f83e8f29
--- /dev/null
+++ b/assets/images/Screen Shot FF 4.png
Binary files differdiff --git a/assets/images/Screen Shot FF 5.png b/assets/images/Screen Shot FF 5.png
new file mode 100644
index 00000000..fc821639
--- /dev/null
+++ b/assets/images/Screen Shot FF 5.png
Binary files differdiff --git a/assets/images/amo-badge.png b/assets/images/amo-badge.png
new file mode 100644
index 00000000..9cb49bba
--- /dev/null
+++ b/assets/images/amo-badge.png
Binary files differdiff --git a/assets/images/buy-me-a-coffee.png b/assets/images/buy-me-a-coffee.png
new file mode 100644
index 00000000..1bb2ad61
--- /dev/null
+++ b/assets/images/buy-me-a-coffee.png
Binary files differdiff --git a/assets/images/chevron-down.svg b/assets/images/chevron-down.svg
new file mode 100644
index 00000000..7679f267
--- /dev/null
+++ b/assets/images/chevron-down.svg
@@ -0,0 +1,3 @@
+<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 512 512'>
+  <polyline points='112 184 256 328 400 184' style='fill:none;stroke:#FF5B56;stroke-linecap:round;stroke-linejoin:round;stroke-width:48px'/>
+</svg>
\ No newline at end of file
diff --git a/assets/images/chrome-badge.png b/assets/images/chrome-badge.png
new file mode 100644
index 00000000..4e48b8a6
--- /dev/null
+++ b/assets/images/chrome-badge.png
Binary files differdiff --git a/assets/images/icon128.png b/assets/images/icon128.png
new file mode 100644
index 00000000..ccd689cc
--- /dev/null
+++ b/assets/images/icon128.png
Binary files differdiff --git a/assets/images/icon16.png b/assets/images/icon16.png
new file mode 100644
index 00000000..1c510cb7
--- /dev/null
+++ b/assets/images/icon16.png
Binary files differdiff --git a/assets/images/icon32.png b/assets/images/icon32.png
new file mode 100644
index 00000000..d001aab6
--- /dev/null
+++ b/assets/images/icon32.png
Binary files differdiff --git a/assets/images/icon48.png b/assets/images/icon48.png
new file mode 100644
index 00000000..4ddd22eb
--- /dev/null
+++ b/assets/images/icon48.png
Binary files differdiff --git a/assets/images/logo-small.png b/assets/images/logo-small.png
new file mode 100644
index 00000000..09e50d18
--- /dev/null
+++ b/assets/images/logo-small.png
Binary files differdiff --git a/assets/images/logo.png b/assets/images/logo.png
new file mode 100644
index 00000000..ecb3e381
--- /dev/null
+++ b/assets/images/logo.png
Binary files differdiff --git a/assets/images/small-tile.png b/assets/images/small-tile.png
new file mode 100644
index 00000000..a3ed077b
--- /dev/null
+++ b/assets/images/small-tile.png
Binary files differdiff --git a/assets/javascript/localise.js b/assets/javascript/localise.js
new file mode 100644
index 00000000..e408025d
--- /dev/null
+++ b/assets/javascript/localise.js
@@ -0,0 +1,19 @@
+window.browser = window.browser || window.chrome;
+
+function localizeHtmlPage() {
+  // Localize using __MSG_***__ data tags
+  var data = document.querySelectorAll('[data-localize]');
+
+  for (var i in data) if (data.hasOwnProperty(i)) {
+    var obj = data[i];
+    var tag = obj.getAttribute('data-localize').toString();
+
+    var msg = tag.replace(/__MSG_(\w+)__/g, function (_match, v1) {
+      return v1 ? browser.i18n.getMessage(v1) : null;
+    });
+
+    if (msg && msg !== tag) obj.innerHTML = msg;
+  }
+}
+
+localizeHtmlPage();
\ No newline at end of file
diff --git a/assets/persist-invidious-prefs.js b/assets/javascript/persist-invidious-prefs.js
index 4c13a310..4c13a310 100644
--- a/assets/persist-invidious-prefs.js
+++ b/assets/javascript/persist-invidious-prefs.js
diff --git a/assets/remove-twitter-sw.js b/assets/javascript/remove-twitter-sw.js
index d1b30637..d9d3ce3e 100644
--- a/assets/remove-twitter-sw.js
+++ b/assets/javascript/remove-twitter-sw.js
@@ -5,17 +5,17 @@ const nitterDefault = 'https://nitter.net';
 let disableNitter;
 let nitterInstance;
 let redirectBypassFlag;
-let whitelist;
+let exceptions;
 
 window.browser = window.browser || window.chrome;
 
-function isNotWhitelisted(url) {
-  return !whitelist.some(regex => (regex.test(url.href)));
+function isNotException(url) {
+  return !exceptions.some(regex => (regex.test(url.href)));
 }
 
 function shouldRedirect(url) {
   return !redirectBypassFlag &&
-    isNotWhitelisted(url) &&
+    isNotException(url) &&
     !disableNitter &&
     url.host !== nitterInstance &&
     !url.pathname.includes('/home');
@@ -32,7 +32,13 @@ function redirectTwitter(url) {
 }
 
 browser.storage.sync.get(
-  ['nitterInstance', 'disableNitter', 'removeTwitterSW', 'redirectBypassFlag'],
+  [
+    'nitterInstance',
+    'disableNitter',
+    'removeTwitterSW',
+    'redirectBypassFlag',
+    'exceptions'
+  ],
   (result) => {
     redirectBypassFlag = result.redirectBypassFlag;
     browser.storage.sync.set({
@@ -41,8 +47,8 @@ browser.storage.sync.get(
     if (!result.removeTwitterSW) {
       disableNitter = result.disableNitter;
       nitterInstance = result.nitterInstance || nitterDefault;
-      whitelist = result.whitelist ? result.whitelist.map(e => {
-        return new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'));
+      exceptions = result.exceptions ? result.exceptions.map(e => {
+        return new RegExp(e);
       }) : [];
       navigator.serviceWorker.getRegistrations().then(registrations => {
         for (let registration of registrations) {