Skip to content

Commit

Permalink
make loads faster
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Apr 2, 2024
1 parent 389abe0 commit 3894ea4
Show file tree
Hide file tree
Showing 27 changed files with 35 additions and 26 deletions.
1 change: 1 addition & 0 deletions layouts/bookmarks/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_bookmarks__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="preconnect" href="https://pbs.twimg.com">
<link rel="preconnect" href="https://dimden.dev">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
Expand Down
2 changes: 1 addition & 1 deletion layouts/bookmarks/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ setTimeout(async () => {
renderDiscovery(false);
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/history/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_history__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="preconnect" href="https://pbs.twimg.com">
<link rel="preconnect" href="https://dimden.dev">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
Expand Down
2 changes: 1 addition & 1 deletion layouts/history/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ setTimeout(async () => {
renderDiscovery(false);
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/home/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_home__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="preconnect" href="https://pbs.twimg.com">
<link rel="preconnect" href="https://dimden.dev">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
Expand Down
4 changes: 2 additions & 2 deletions layouts/home/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ setTimeout(async () => {

// weird bug
if(!document.getElementById('new-tweets')) {
return // setTimeout(() => location.reload(), 1500);
return setTimeout(() => location.reload(), 2500);
}
try {
let lastNewTweetPress = Date.now();
Expand All @@ -438,7 +438,7 @@ setTimeout(async () => {
timeline.dataToUpdate = [];
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/itl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_tweets__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="preconnect" href="https://pbs.twimg.com">
<link rel="preconnect" href="https://dimden.dev">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
Expand Down
2 changes: 1 addition & 1 deletion layouts/itl/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ setTimeout(async () => {
renderDiscovery(false);
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/lists/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_list__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="preconnect" href="https://pbs.twimg.com">
<link rel="preconnect" href="https://dimden.dev">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
Expand Down
4 changes: 2 additions & 2 deletions layouts/lists/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,14 @@ setTimeout(async () => {
}
// weird bug
if(!document.getElementById('wtf-refresh')) {
return // setTimeout(() => location.reload(), 1500);
return setTimeout(() => location.reload(), 2500);
}
try {
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/notifications/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_notifications__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="preconnect" href="https://pbs.twimg.com">
<link rel="preconnect" href="https://dimden.dev">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
Expand Down
4 changes: 2 additions & 2 deletions layouts/notifications/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ setTimeout(async () => {

// weird bug
if(!document.getElementById('wtf-refresh')) {
return // setTimeout(() => location.reload(), 1500);
return setTimeout(() => location.reload(), 2500);
}
try {
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/profile/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_profile__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="preconnect" href="https://pbs.twimg.com">
<link rel="preconnect" href="https://dimden.dev">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
Expand Down
4 changes: 2 additions & 2 deletions layouts/profile/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,7 @@ setTimeout(async () => {

// weird bug
if(!document.getElementById('new-tweets')) {
return // setTimeout(() => location.reload(), 1500);
return setTimeout(() => location.reload(), 2500);
}
try {
document.getElementById('new-tweets').addEventListener('click', () => {
Expand All @@ -1821,7 +1821,7 @@ setTimeout(async () => {
renderTimeline();
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/search/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_search__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="preconnect" href="https://pbs.twimg.com">
<link rel="preconnect" href="https://dimden.dev">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
Expand Down
4 changes: 2 additions & 2 deletions layouts/search/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,14 @@ setTimeout(async () => {

// weird bug
if(!document.getElementById('wtf-refresh')) {
return // setTimeout(() => location.reload(), 1500);
return setTimeout(() => location.reload(), 2500);
}
try {
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/settings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_settings__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
</head>
<body id="injected-body">
Expand Down
2 changes: 1 addition & 1 deletion layouts/settings/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ setTimeout(async () => {
renderDiscovery(false);
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/topics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_topic__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="preconnect" href="https://pbs.twimg.com">
<link rel="preconnect" href="https://dimden.dev">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
Expand Down
4 changes: 2 additions & 2 deletions layouts/topics/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ setTimeout(async () => {

// weird bug
if(!document.getElementById('wtf-refresh')) {
return // setTimeout(() => location.reload(), 1500);
return setTimeout(() => location.reload(), 2500);
}
try {
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/tweet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_tweet__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="preconnect" href="https://pbs.twimg.com">
<link rel="preconnect" href="https://dimden.dev">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
Expand Down
4 changes: 2 additions & 2 deletions layouts/tweet/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -783,14 +783,14 @@ setTimeout(async () => {
}
// weird bug
if(!document.getElementById('wtf-refresh')) {
return // setTimeout(() => location.reload(), 1500);
return setTimeout(() => location.reload(), 2500);
}
try {
document.getElementById('wtf-refresh').addEventListener('click', async () => {
renderDiscovery(false);
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
1 change: 1 addition & 0 deletions layouts/unfollows/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__MSG_unfollowers__ - __MSG_twitter__</title>
<link rel="preconnect" href="https://twitter.com">
<link rel="preconnect" href="https://abs.twimg.com">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
</head>
<body id="injected-body">
Expand Down
2 changes: 1 addition & 1 deletion layouts/unfollows/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ setTimeout(async () => {
renderDiscovery(false);
});
} catch(e) {
// setTimeout(() => location.reload(), 1500);
setTimeout(() => location.reload(), 2500);
console.error(e);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Old Twitter Layout (2024)",
"description": "__MSG_ext_description__",
"version": "1.8.3.5",
"version": "1.8.3.6",
"manifest_version": 3,
"homepage_url": "https://github.com/dimdenGD/OldTwitter",
"background": {
Expand Down
5 changes: 0 additions & 5 deletions scripts/injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,6 @@ let page = realPath === "" ? pages[0] : pages.find(p => (!p.exclude || !p.exclud
LOC = LOC_DATA; LOC_EN = LOC_EN_DATA;
LOC_EN.extension_id = {message: chrome.runtime.id};

try {
await initChallenge();
} catch(e) {
console.error('Error initializing challenge', e);
}
try {
let cryptoKey = await readCryptoKey();
if(cryptoKey) {
Expand Down
4 changes: 3 additions & 1 deletion scripts/twchallenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,6 @@ async function initChallenge() {
console.error(e);
return false;
}
};
};

initChallenge();

0 comments on commit 3894ea4

Please sign in to comment.