Skip to content

Commit 74b317a

Browse files
author
github-actions
committed
Release from Ophirofox v2.6.815.1917
1 parent 0668259 commit 74b317a

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

ophirofox.user.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ==UserScript==
2-
// @version 2.6.815.112
2+
// @version 2.6.815.1917
33
// @author Write
44
// @name OphirofoxScript
55
// @grant GM.getValue
@@ -1922,18 +1922,21 @@
19221922
(elem) => elem.textContent == "Se connecter"
19231923
);
19241924

1925-
let articlePath = '';
1925+
let articlePath;
19261926
await chrome.storage.sync.get(['ophirofox_mediapart_article']).then((result) => {
19271927
articlePath = result.ophirofox_mediapart_article
19281928
})
19291929

19301930
let currentPage = new URL(window.location)
1931+
let isRedirectArticle = articlePath && currentPage.pathname != articlePath
19311932
if (isNotConnected) {
19321933
console.error("ophirofox login failed")
19331934
return
1934-
} else if (currentPage.pathname != articlePath) {
1935+
} else if (isRedirectArticle) {
19351936
//redirect to mirror article
19361937
window.location.pathname = articlePath
1938+
//clear storage to enable futur navigation on the mirror
1939+
chrome.storage.sync.remove(["ophirofox_mediapart_article"])
19371940
}
19381941
}
19391942

@@ -2020,18 +2023,21 @@
20202023
(elem) => elem.textContent == "Se connecter"
20212024
);
20222025

2023-
let articlePath = '';
2026+
let articlePath;
20242027
await chrome.storage.sync.get(['ophirofox_mediapart_article']).then((result) => {
20252028
articlePath = result.ophirofox_mediapart_article
20262029
})
20272030

20282031
let currentPage = new URL(window.location)
2032+
let isRedirectArticle = articlePath && currentPage.pathname != articlePath
20292033
if (isNotConnected) {
20302034
console.error("ophirofox login failed")
20312035
return
2032-
} else if (currentPage.pathname != articlePath) {
2036+
} else if (isRedirectArticle) {
20332037
//redirect to mirror article
20342038
window.location.pathname = articlePath
2039+
//clear storage to enable futur navigation on the mirror
2040+
chrome.storage.sync.remove(["ophirofox_mediapart_article"])
20352041
}
20362042
}
20372043

@@ -2118,18 +2124,21 @@
21182124
(elem) => elem.textContent == "Se connecter"
21192125
);
21202126

2121-
let articlePath = '';
2127+
let articlePath;
21222128
await chrome.storage.sync.get(['ophirofox_mediapart_article']).then((result) => {
21232129
articlePath = result.ophirofox_mediapart_article
21242130
})
21252131

21262132
let currentPage = new URL(window.location)
2133+
let isRedirectArticle = articlePath && currentPage.pathname != articlePath
21272134
if (isNotConnected) {
21282135
console.error("ophirofox login failed")
21292136
return
2130-
} else if (currentPage.pathname != articlePath) {
2137+
} else if (isRedirectArticle) {
21312138
//redirect to mirror article
21322139
window.location.pathname = articlePath
2140+
//clear storage to enable futur navigation on the mirror
2141+
chrome.storage.sync.remove(["ophirofox_mediapart_article"])
21332142
}
21342143
}
21352144

0 commit comments

Comments
 (0)