Skip to content

Commit 3faa684

Browse files
committed
2 parents a719006 + 9bba0d9 commit 3faa684

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/background/open.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ function openTab(tab, currentWindow, isOpenToLastIndex = false) {
253253
}
254254

255255
//Reader mode
256-
if (tab.url.substr(0, 17) == "about:reader?url=") {
256+
if (tab.url.startsWith("about:reader?url=")) {
257257
if (getSettings("ifLazyLoading")) {
258258
createOption.url = returnReplaceURL(
259259
"redirect",
@@ -263,7 +263,7 @@ function openTab(tab, currentWindow, isOpenToLastIndex = false) {
263263
);
264264
} else {
265265
if (isEnabledOpenInReaderMode) createOption.openInReaderMode = true;
266-
createOption.url = decodeURIComponent(tab.url.substr(17));
266+
createOption.url = decodeURIComponent(tab.url.slice(17));
267267
}
268268
}
269269

src/background/replace.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ export function returnReplaceURL(state, title, url, favIconUrl) {
3737
theme;
3838

3939
//Reader mode
40-
if (url.substr(0, 17) == "about:reader?url=") {
40+
if (url.startsWith("about:reader?url=")) {
4141
retUrl =
4242
"replaced/index.html" +
4343
"?state=" +
4444
encodeURIComponent(state) +
4545
"&title=" +
4646
encodeURIComponent(title) +
4747
"&url=" +
48-
url.substr(17) +
48+
url.slice(17) +
4949
"&favIconUrl=" +
5050
encodeURIComponent(favIconUrl) +
5151
"&openInReaderMode=true" +

src/options/components/ImportSessionsComponent.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const fileOpen = file => {
2929
let text = reader.result;
3030
if (file.name.toLowerCase().endsWith(".json")) {
3131
// Ignore BOM
32-
if (text.charCodeAt(0) === 0xFEFF) text = text.substr(1);
32+
if (text.charCodeAt(0) === 0xFEFF) text = text.slice(1);
3333
if (!isJSON(text)) return resolve();
3434

3535
let jsonFile = JSON.parse(text);
@@ -152,11 +152,11 @@ const convertSessionManager = file => {
152152
session.windows = {};
153153
session.windowsNumber = 0;
154154
session.tabsNumber = 0;
155-
session.name = line[1].substr(5);
156-
session.date = moment(parseInt(line[2].substr(10))).valueOf();
155+
session.name = line[1].slice(5);
156+
session.date = moment(parseInt(line[2].slice(10))).valueOf();
157157
session.lastEditedTime = Date.now();
158158
session.tag = [];
159-
session.sessionStartTime = parseInt(line[2].substr(10));
159+
session.sessionStartTime = parseInt(line[2].slice(10));
160160
session.id = uuidv4();
161161

162162
if (!isJSON(line[4])) return;

0 commit comments

Comments
 (0)