From 4e7970a39edaf7d0adb72779f4e1bbcf4a342518 Mon Sep 17 00:00:00 2001 From: dimden Date: Thu, 21 Jul 2022 18:43:40 +0300 Subject: [PATCH] fixes --- README.md | 1 + manifest.json | 2 +- pack.js | 4 ++-- scripts/apis.js | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a00c384a..95a4545f 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ Go to [mobile.twitter.com](https://mobile.twitter.com). - Tweet pages - Tweeting and bundled user search in tweet input - Media uploads +- Poll support - Direct Messages support - Ability to change default link color and font - Ability to enable/disable Twemoji diff --git a/manifest.json b/manifest.json index 26e601dd..60f07824 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Old Twitter Layout (2022)", "description": "A new extension that returns old Twitter's look.", - "version": "1.1.3", + "version": "1.1.4", "manifest_version": 3, "homepage_url": "https://github.com/dimdenGD/OldTwitter", "background": { diff --git a/pack.js b/pack.js index da9019d1..e89fcca1 100644 --- a/pack.js +++ b/pack.js @@ -54,7 +54,7 @@ copyDir('./', '../OldTwitterFirefox').then(async () => { content = content.replace("document.close();", ""); let background = fs.readFileSync('../OldTwitterFirefox/scripts/background.js', 'utf8'); - background = background.replace(/chrome\.storage\.sync\./, "chrome.storage.local."); + background = background.replace(/chrome\.storage\.sync\./g, "chrome.storage.local."); background += ` chrome.webRequest.onBeforeRequest.addListener( function(details) { @@ -102,7 +102,7 @@ copyDir('./', '../OldTwitterFirefox').then(async () => { let layouts = fs.readdirSync('../OldTwitterFirefox/layouts'); for (let layout of layouts) { let script = fs.readFileSync(`../OldTwitterFirefox/layouts/${layout}/script.js`, 'utf8'); - script = script.replace(/chrome\.storage\.sync\./, "chrome.storage.local."); + script = script.replace(/chrome\.storage\.sync\./g, "chrome.storage.local."); fs.writeFileSync(`../OldTwitterFirefox/layouts/${layout}/script.js`, script); } diff --git a/scripts/apis.js b/scripts/apis.js index 80e6b77d..c15ad15b 100644 --- a/scripts/apis.js +++ b/scripts/apis.js @@ -330,7 +330,7 @@ function generatePollCode(tweet, tweetElement, user) { choiceElement.innerHTML = `
- ${choice.label} + ${escape(choice.label)} ${choice.selected ? `` : ''}
${isFinite(choice.percentage) ? `
${choice.count} (${choice.percentage}%)
` : '
0
'} @@ -344,7 +344,7 @@ function generatePollCode(tweet, tweetElement, user) { choiceElement.classList.add('choice', 'choice-unselected'); choiceElement.innerHTML = `
-
${choice.label}
+
${escape(choice.label)}
`; choiceElement.addEventListener('click', async () => { let newCard = await API.pollVote(poll.api.string_value, tweet.id_str, tweet.card.url, tweet.card.name, choice.id);