Skip to content

Commit

Permalink
Added imgur.io SimonBrazell#346. Fixed a typo in Unify. Fixed typo in…
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Jun 19, 2022
1 parent 3e20796 commit 8b7581e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/assets/javascripts/imgur.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ window.browser = window.browser || window.chrome;

import utils from './utils.js'

const targets = /^https?:\/{2}([im]\.)?imgur\.com(\/|$)/
const targets = /^https?:\/{2}([im]\.)?imgur\.(com|io)(\/|$)/

let redirects = {
"rimgo": {
Expand Down
24 changes: 14 additions & 10 deletions src/assets/javascripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,21 @@ function getCookiesFromStorage(frontend, urls, name) {
browser.storage.local.get([key, 'firstPartyIsolate'], r => {
const cookie = r[key];
if (cookie === undefined) return;
let query;
if (!r.firstPartyIsolate) query = {
url: url, name: cookie.name, value: cookie.value, secure: true,
expirationDate: cookie.expirationDate,
};
else query = {
url: url, name: cookie.name, value: cookie.value, secure: true,
expirationDate: null,
firstPartyDomain: new URL(url).hostname,
for (const url of urls) {
let query =
r.firstPartyIsolate ?
{
url: url, name: cookie.name, value: cookie.value, secure: true,
expirationDate: null,
firstPartyDomain: new URL(url).hostname,
}
:
{
url: url, name: cookie.name, value: cookie.value, secure: true,
expirationDate: cookie.expirationDate,
};
browser.cookies.set(query)
}
for (const url of urls) browser.cookies.set(query)
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "2.2.0",
"version": "2.2.1",
"manifest_version": 2,
"browser_specific_settings": {
"gecko": {
Expand Down
4 changes: 4 additions & 0 deletions src/pages/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ let disableElement = document.getElementById("disable-simplyTranslate");
let disableWikipediaElement = document.getElementById("disable-wikipedia");
let disableMediumElement = document.getElementById("disable-medium");
let disableQuoraElement = document.getElementById("disable-quora");
let disableImdbElement = document.getElementById("disable-imdb");
let disableReutersElement = document.getElementById("disable-reuters");
let disablePeertubeElement = document.getElementById("disable-peertube");
let disableLbryElement = document.getElementById("disable-lbry");
Expand All @@ -67,6 +68,7 @@ browser.storage.local.get(
"disableTiktok",
"disableMedium",
"disableQuora",
"disableImdb",
"disableReuters",
"disablePeertubeTargets",
"disableLbryTargets",
Expand All @@ -88,6 +90,7 @@ browser.storage.local.get(
disableTiktokElement.checked = !r.disableTiktok;
disableMediumElement.checked = !r.disableMedium;
disableQuoraElement.checked = !r.disableQuora;
disableImdbElement.checked = !r.disableImdb;
disableReutersElement.checked = !r.disableReuters;
disablePeertubeElement.checked = !r.disablePeertubeTargets;
disableLbryElement.checked = !r.disableLbryTargets;
Expand Down Expand Up @@ -116,6 +119,7 @@ document.addEventListener("change", () => {
disableTiktok: !disableTiktokElement.checked,
disableMedium: !disableMediumElement.checked,
disableQuora: !disableQuoraElement.checked,
disableImdb: !disableImdbElement.checked,
disableReuters: !disableReutersElement.checked,
disablePeertubeTargets: !disablePeertubeElement.checked,
disableLbryTargets: !disableLbryElement.checked,
Expand Down

0 comments on commit 8b7581e

Please sign in to comment.