Skip to content

Commit 64014cf

Browse files
committed
Fixed thing in reddit. Fixed bug in incognito, Fixed localise module error. Bump => 2.1.0
1 parent 22b6878 commit 64014cf

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

chromium.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Linux
2-
- Download the latest `.crx` file: [libredirect-2.0.0.crx](https://github.com/libredirect/libredirect/releases/download/v2.0.0/libredirect-2.0.0.crx)
2+
- Download the latest `.crx` file: [libredirect-2.1.0.crx](https://github.com/libredirect/libredirect/releases/download/v2.1.0/libredirect-2.1.0.crx)
33
- Open `chrome://extensions`
44
- Enable `dev mode`
55
- Rerfesh the page
@@ -8,11 +8,11 @@
88
Updates are automatic
99

1010
## Windows, MacOS
11-
- Download the latest release [libredirect-2.0.0.zip](https://github.com/libredirect/libredirect/releases/download/v2.0.0/libredirect-2.0.0.zip)
11+
- Download the latest release [libredirect-2.1.0.zip](https://github.com/libredirect/libredirect/releases/download/v2.1.0/libredirect-2.1.0.zip)
1212
- Unzip it with `Auto detect subfolder`
1313
- Open `chrome://extensions`
1414
- Enable `dev mode`
15-
- Click `Load unpacked`. Select and Open `libredirect-2.0.0/`
15+
- Click `Load unpacked`. Select and Open `libredirect-2.1.0/`
1616

1717
https://user-images.githubusercontent.com/40805353/159987051-8be73cd3-3fdf-4dd0-99d4-8886674fbdb6.mp4
1818

src/assets/javascripts/reddit.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,34 +240,34 @@ function redirect(url, type, initiator) {
240240
if (redditFrontend == 'teddit') {
241241
if (tedditInstancesList.length === 0) return;
242242
let tedditRandomInstance = utils.getRandomInstance(tedditInstancesList);
243-
return `${tedditRandomInstance}/pics/w:null_${url.pathname.substring(1)}${url.reddit}`;
243+
return `${tedditRandomInstance}/pics/w:null_${url.pathname.substring(1)}${url.search}`;
244244
}
245245
if (redditFrontend == 'libreddit') {
246246
if (libredditInstancesList.length === 0) return;
247247
let libredditRandomInstance = utils.getRandomInstance(libredditInstancesList);
248-
return `${libredditRandomInstance}/img${url.pathname}${url.reddit}`
248+
return `${libredditRandomInstance}/img${url.pathname}${url.search}`
249249
}
250250
}
251251
else if (url.host === "redd.it") {
252252
if (redditFrontend == 'libreddit' && !url.pathname.match(/^\/+[^\/]+\/+[^\/]/)) {
253253
if (libredditInstancesList.length === 0) return;
254254
let libredditRandomInstance = utils.getRandomInstance(libredditInstancesList);
255255
// https://redd.it/foo => https://libredd.it/comments/foo
256-
return `${libredditRandomInstance}/comments${url.pathname}${url.reddit}`;
256+
return `${libredditRandomInstance}/comments${url.pathname}${url.search}`;
257257
}
258258
if (redditFrontend == 'teddit' && !url.pathname.match(/^\/+[^\/]+\/+[^\/]/)) {
259259
if (tedditInstancesList.length === 0) return;
260260
let tedditRandomInstance = utils.getRandomInstance(tedditInstancesList);
261261
// https://redd.it/foo => https://teddit.net/comments/foo
262-
return `${tedditRandomInstance}/comments${url.pathname}${url.reddit}`
262+
return `${tedditRandomInstance}/comments${url.pathname}${url.search}`
263263
}
264264
}
265265
else if (url.host === 'preview.redd.it') {
266266
if (redditFrontend == 'teddit') return;
267267
if (redditFrontend == 'libreddit') {
268268
if (libredditInstancesList.length === 0) return;
269269
const libredditRandomInstance = utils.getRandomInstance(libredditInstancesList);
270-
return `${libredditRandomInstance}/preview/pre${url.pathname}${url.reddit}`;
270+
return `${libredditRandomInstance}/preview/pre${url.pathname}${url.search}`;
271271
}
272272
}
273273

src/pages/background/background.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ browser.tabs.onCreated.addListener(
139139
tab => {
140140
if (tab.incognito) {
141141
incognitoList.push(tab.id);
142-
if (incognitoList.length == 1) browser.tabs.create({ url: browser.runtime.getURL("/pages/background/incognito.html") });
142+
if (incognitoList.length == 1) browser.tabs.create({ url: browser.runtime.getURL("/pages/background/incognito.html"), active: false });
143143
}
144144
}
145145
);

src/pages/errors/instance_offline.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@
2929

3030
<body>
3131
<div>
32-
<p id="message" data-localise="__MSG_instanceOffline__">This instance is offline, you'll be redirected after&nbsp;<span
33-
id="number">2</span>&nbsp;<x data-localise="__MSG_sec__">seconds</x>
32+
<p id="message" data-localise="__MSG_instanceOffline__">This instance is offline, you'll be redirected
33+
after&nbsp;<span id="number">2</span>&nbsp;<x data-localise="__MSG_sec__">seconds</x>
3434
</p>
3535
<button id="cancel" data-localise="__MSG_cancel__">Cancel</button>
3636
</div>
3737

38-
<script src="instance_offline.js"></script>
39-
<script src="../../assets/javascripts/localise.js"></script>
38+
<script src="instance_offline.js" type="module"></script>
4039
</body>
4140

42-
</html>
41+
</html>

src/pages/errors/instance_offline.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import localise from "../../assets/javascripts/localise.js";
2+
3+
14
const params = new Proxy(
25
new URLSearchParams(window.location.search),
36
{ get: (searchParams, prop) => searchParams.get(prop) }
@@ -18,3 +21,5 @@ document.getElementById("cancel").addEventListener("click", () => {
1821
isCanceled = true;
1922
document.getElementById("message").innerHTML = browser.i18n.getMessage('redirectionCanceled');
2023
})
24+
25+
localise.localisePage();

src/updates/updates.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
33
<app appid='oladmjdebphlnjjcnomfhhbfdldiimaf'>
4-
<updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v2.0.0/libredirect-2.0.0.crx' version='2.0.0' />
4+
<updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v2.1.0/libredirect-2.1.0.crx' version='2.1.0' />
55
</app>
66
</gupdate>

0 commit comments

Comments
 (0)