aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2022-08-02 18:16:17 +0300
committerManeraKai <manerakai@protonmail.com>2022-08-02 18:16:17 +0300
commitec846f238854e415c07e5f6db2dae7668abb7dae (patch)
tree2a510e7149159b609ae4fb10acaf74c1df697b03
parentSome tweaks on bibliogram settings (diff)
downloadlibredirect-ec846f238854e415c07e5f6db2dae7668abb7dae.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 98dbe3da..f070deca 100644
--- a/src/assets/javascripts/utils.js
+++ b/src/assets/javascripts/utils.js
@@ -315,19 +315,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
@@ -346,20 +346,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)
}
})
@@ -368,16 +368,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)
}
@@ -387,7 +387,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 => {