Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Jul 21, 2022
1 parent 9cdbfb8 commit 4e7970a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 (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": {
Expand Down
4 changes: 2 additions & 2 deletions pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ function generatePollCode(tweet, tweetElement, user) {
choiceElement.innerHTML = `
<div class="choice-bg" style="width:${choice.percentage}%" data-percentage="${choice.percentage}"></div>
<div class="choice-label">
<span>${choice.label}</span>
<span>${escape(choice.label)}</span>
${choice.selected ? `<span class="choice-selected"></span>` : ''}
</div>
${isFinite(choice.percentage) ? `<div class="choice-count">${choice.count} (${choice.percentage}%)</div>` : '<div class="choice-count">0</div>'}
Expand All @@ -344,7 +344,7 @@ function generatePollCode(tweet, tweetElement, user) {
choiceElement.classList.add('choice', 'choice-unselected');
choiceElement.innerHTML = `
<div class="choice-bg" style="width:100%"></div>
<div class="choice-label">${choice.label}</div>
<div class="choice-label">${escape(choice.label)}</div>
`;
choiceElement.addEventListener('click', async () => {
let newCard = await API.pollVote(poll.api.string_value, tweet.id_str, tweet.card.url, tweet.card.name, choice.id);
Expand Down

0 comments on commit 4e7970a

Please sign in to comment.