about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--images/Screen Shot 1.png (renamed from img/Screen Shot 1.png)bin415406 -> 415406 bytes
-rw-r--r--images/Screen Shot 2.png (renamed from img/Screen Shot 2.png)bin811174 -> 811174 bytes
-rw-r--r--images/icon128.png (renamed from img/icon128.png)bin3197 -> 3197 bytes
-rw-r--r--images/icon16.pngbin0 -> 976 bytes
-rw-r--r--images/icon32.pngbin0 -> 1983 bytes
-rw-r--r--images/icon48.png (renamed from img/icon48.png)bin1063 -> 1063 bytes
-rw-r--r--images/logo.pngbin0 -> 31646 bytes
-rw-r--r--images/small-tile.png (renamed from img/small-tile.png)bin35583 -> 35583 bytes
-rw-r--r--manifest.json24
-rw-r--r--pages/options/options.html27
-rw-r--r--pages/popup/popup.css140
-rw-r--r--pages/popup/popup.html48
-rw-r--r--pages/popup/popup.js7
13 files changed, 242 insertions, 4 deletions
diff --git a/img/Screen Shot 1.png b/images/Screen Shot 1.png
index 7363026a..7363026a 100644
--- a/img/Screen Shot 1.png
+++ b/images/Screen Shot 1.png
Binary files differdiff --git a/img/Screen Shot 2.png b/images/Screen Shot 2.png
index f131363d..f131363d 100644
--- a/img/Screen Shot 2.png
+++ b/images/Screen Shot 2.png
Binary files differdiff --git a/img/icon128.png b/images/icon128.png
index ccd689cc..ccd689cc 100644
--- a/img/icon128.png
+++ b/images/icon128.png
Binary files differdiff --git a/images/icon16.png b/images/icon16.png
new file mode 100644
index 00000000..1c510cb7
--- /dev/null
+++ b/images/icon16.png
Binary files differdiff --git a/images/icon32.png b/images/icon32.png
new file mode 100644
index 00000000..d001aab6
--- /dev/null
+++ b/images/icon32.png
Binary files differdiff --git a/img/icon48.png b/images/icon48.png
index 4ddd22eb..4ddd22eb 100644
--- a/img/icon48.png
+++ b/images/icon48.png
Binary files differdiff --git a/images/logo.png b/images/logo.png
new file mode 100644
index 00000000..db4030ff
--- /dev/null
+++ b/images/logo.png
Binary files differdiff --git a/img/small-tile.png b/images/small-tile.png
index a3ed077b..a3ed077b 100644
--- a/img/small-tile.png
+++ b/images/small-tile.png
Binary files differdiff --git a/manifest.json b/manifest.json
index 1a142fd8..d3140805 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
 {
   "name": "Privacy Redirect",
   "description": "Redirects Twitter & Youtube requests to privacy friendly alternatives (Nitter & Invidious).",
-  "version": "1.0.0",
+  "version": "1.0.2",
   "manifest_version": 2,
   "background": {
     "scripts": [
@@ -9,10 +9,13 @@
     ]
   },
   "icons": {
-    "48": "img/icon48.png",
-    "128": "img/icon128.png"
+    "16": "images/icon16.png",
+    "32": "images/icon32.png",
+    "48": "images/icon48.png",
+    "128": "images/icon128.png"
   },
   "permissions": [
+    "storage",
     "webRequest",
     "webRequestBlocking",
     "*://twitter.com/*",
@@ -23,5 +26,18 @@
     "*://youtube-nocookie.com/*",
     "*://www.youtube-nocookie.com/*",
     "*://m.youtube.com/"
-  ]
+  ],
+  "browser_action": {
+    "default_popup": "pages/popup/popup.html",
+    "default_icon": {
+      "16": "images/icon16.png",
+      "32": "images/icon32.png",
+      "48": "images/icon48.png",
+      "128": "images/icon128.png"
+    }
+  },
+  "options_ui": {
+    "page": "pages/options/options.html",
+    "open_in_tab": false
+  }
 }
\ No newline at end of file
diff --git a/pages/options/options.html b/pages/options/options.html
new file mode 100644
index 00000000..f51f7201
--- /dev/null
+++ b/pages/options/options.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+  <title>My Test Extension Options</title>
+</head>
+
+<body>
+
+  Favorite color:
+  <select id="color">
+    <option value="red">red</option>
+    <option value="green">green</option>
+    <option value="blue">blue</option>
+    <option value="yellow">yellow</option>
+  </select>
+
+  <label>
+    <input type="checkbox" id="like">
+    I like colors.
+  </label>
+
+  <div id="status"></div>
+  <button id="save">Save</button>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/pages/popup/popup.css b/pages/popup/popup.css
new file mode 100644
index 00000000..eebab8e3
--- /dev/null
+++ b/pages/popup/popup.css
@@ -0,0 +1,140 @@
+:root {
+  --text-main: #FFF;
+  --text-secondary: #000;
+  --dark-grey: #3C4043;
+  --white: #FFF;
+  --active: #FF5B56;
+  --space: 5px;
+}
+
+body {
+  color: var(--text-secondary);
+  margin: 0;
+  max-width: 400px;
+  min-width: 240px;
+  background-color: var(--dark-grey)
+}
+
+header {
+  background-color: var(--white);
+  color: var(--text-secondary);
+  display: flex;
+  padding: var(--space);
+}
+
+header h1 {
+  font-size: 2em;
+}
+
+header .logo-container {
+  margin: var(--space);
+}
+
+header .logo-container img {
+  width: 100%;
+}
+
+header small {
+  display: block;
+  font-size: .70em;
+  font-weight: bold;
+  margin: 1%;
+  width: 100%;
+  text-align: right;
+}
+
+h1 {
+  font-size: 14px;
+  margin: var(--space) auto
+}
+
+h2 {
+  clear: both;
+  font-size: 12px;
+  font-weight: normal;
+  margin: 0;
+}
+
+h3 {
+  font-size: 16px;
+}
+
+h1,
+h2 {
+  color: var(--text-main);
+}
+
+footer {
+  width: 100%;
+}
+
+footer a.button {
+  margin: var(--space);
+}
+
+/* Elements */
+input[type=checkbox] {
+  opacity: 0;
+}
+
+label {
+  background: grey;
+  border-radius: 25px;
+  color: var(--text-main);
+  cursor: pointer;
+  display: block;
+  float: right;
+  font-weight: bold;
+  height: 30px;
+  position: relative;
+  text-indent: -400px;
+  width: 50px;
+}
+
+label:after {
+  background: #fff;
+  border-radius: 90px;
+  content: '';
+  height: 20px;
+  left: 5px;
+  position: absolute;
+  top: 5px;
+  transition: 0.3s; /* Acts on transform below */
+  width: 20px;
+}
+input:checked+label {
+  background: var(--active);
+}
+/* position  when active*/
+input:checked+label:after {
+  left: calc(100% - 5px);
+  transform: translateX(-100%);
+}
+
+.settings_block {
+  display: block;
+  padding: 5px 1em 20px 1em;
+  border-bottom: var(--dark-grey) solid 1px;
+}
+
+.settings_block h1 {
+  float: left;
+}
+
+.button {
+  border: var(--active) solid 1px;
+  color: var(--text-main);
+  display: block;
+  font-size: 12px;
+  font-weight: bold;
+  margin: var(--space) auto;
+  padding: 10px;
+  text-align: center;
+  text-decoration: none;
+}
+
+.button:hover {
+  background-color: var(--active);
+  color: #fff
+}
+
diff --git a/pages/popup/popup.html b/pages/popup/popup.html
new file mode 100644
index 00000000..0e28a99a
--- /dev/null
+++ b/pages/popup/popup.html
@@ -0,0 +1,48 @@
+<!doctype html>
+<html>
+
+<head>
+  <meta charset="utf-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+  <title></title>
+  <link href="./popup.css" rel="stylesheet">
+</head>
+
+<body>
+  <header>
+    <div class="logo-container">
+      <img src="../../images/logo.png" alt="Privacy Redirect logo">
+    </div>
+    <small>
+      <span>Version</span>: 1.0.2</span>
+    </small>
+  </header>
+
+  <section id="disableNitter" class="options settings_block">
+    <div class="onoffswitch switch" aria-label="Toggle Nitter redirects">
+      <h1 id="onoffswitch_label">Nitter Redirects</h1>
+      <span class="slider round"></span>
+      <input aria-hidden="true" id="onoffnitter" type="checkbox" checked> <label id="onoffnitter__label"
+        for="onoffnitter">
+      </label>
+    </div>
+  </section>
+
+  <section id="disableInvidious" class="options settings_block">
+    <div class="onoffswitch switch" aria-label="Toggle Invidious redirects">
+      <h1 id="onoffinvidious_label">Invidious Redirects</h1>
+      <span class="slider round"></span>
+      <input aria-hidden="true" id="onoffinvidious" type="checkbox" checked> <label id="onoffinvidious_label"
+        for="onoffinvidious">
+      </label>
+    </div>
+  </section>
+
+  <footer>
+    <a class="button" id="options" target="_blank">Options</a>
+  </footer>
+
+  <script src="./popup.js"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/pages/popup/popup.js b/pages/popup/popup.js
new file mode 100644
index 00000000..0dddb49c
--- /dev/null
+++ b/pages/popup/popup.js
@@ -0,0 +1,7 @@
+document.querySelector('#options').addEventListener('click', function () {
+  if (chrome.runtime.openOptionsPage) {
+    chrome.runtime.openOptionsPage();
+  } else {
+    window.open(chrome.runtime.getURL('../options/options.html'));
+  }
+});
\ No newline at end of file