aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2022-08-02 18:16:17 +0300
committerBobIsMyManager <bimmgitsignature.nly8m@simplelogin.co>2022-08-02 22:03:33 +0100
commitc3a5208fdcb052606bad1d8faf68ba00c18078ac (patch)
tree719686e002d94eb44e440cea0f8835ac6d21f224
parentrebase (diff)
downloadlibredirect-c3a5208fdcb052606bad1d8faf68ba00c18078ac.zip
Prettier format
Diffstat (limited to '')
-rw-r--r--src/assets/javascripts/utils.js59
1 files changed, 29 insertions, 30 deletions
diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js
index a6b011a3..23a882af 100644
--- a/src/assets/javascripts/utils.js
+++ b/src/assets/javascripts/utils.js
@@ -352,19 +352,19 @@ function copyCookie(frontend, targetUrl, urls, name) {
for (const url of urls) {
const setQuery = r.firstPartyIsolate
? {
- url: url,
- name: name,
- value: cookie.value,
- secure: true,
- firstPartyDomain: new URL(url).hostname,
- }
+ url: url,
+ name: name,
+ value: cookie.value,
+ secure: true,
+ firstPartyDomain: new URL(url).hostname,
+ }
: {
- url: url,
- name: name,
- value: cookie.value,
- secure: true,
- expirationDate: cookie.expirationDate,
- }
+ url: url,
+ name: name,
+ value: cookie.value,
+ secure: true,
+ expirationDate: cookie.expirationDate,
+ }
browser.cookies.set(setQuery, () => browser.storage.local.set({ [`${frontend}_${name}`]: cookie }, () => resolve()))
}
break
@@ -383,20 +383,20 @@ function getCookiesFromStorage(frontend, urls, name) {
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: null,
+ firstPartyDomain: new URL(url).hostname,
+ }
: {
- url: url,
- name: cookie.name,
- value: cookie.value,
- secure: true,
- expirationDate: cookie.expirationDate,
- }
+ url: url,
+ name: cookie.name,
+ value: cookie.value,
+ secure: true,
+ expirationDate: cookie.expirationDate,
+ }
browser.cookies.set(query)
}
})
@@ -405,16 +405,16 @@ function getCookiesFromStorage(frontend, urls, name) {
function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) {
return new Promise(resolve => {
browser.storage.local.get("firstPartyIsolate", r => {
- const http = new XMLHttpRequest();
+ const http = new XMLHttpRequest()
const url = `${targetUrl}${endpoint}`
http.open("GET", url, false)
http.setRequestHeader("Cookie", `${name}=${cookie.value}`)
http.send(null)
const preferences = JSON.parse(http.responseText)
- let formdata = new FormData();
- for (var key in preferences) formdata.append(key, preferences[key]);
+ let formdata = new FormData()
+ for (var key in preferences) formdata.append(key, preferences[key])
for (const url of urls) {
- const http = new XMLHttpRequest();
+ const http = new XMLHttpRequest()
http.open("POST", `${url}/settings/stay`, false)
http.send(null)
}
@@ -424,7 +424,6 @@ function getPreferencesFromToken(frontend, targetUrl, urls, name, endpoint) {
})
}
-
function copyRaw(test, copyRawElement) {
return new Promise(resolve => {
browser.tabs.query({ active: true, currentWindow: true }, async tabs => {