Skip to content

Commit 8d83076

Browse files
committed
Fix popup on firefox
1 parent 1743787 commit 8d83076

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/content.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const manualSkipPercentCount = 0.5;
123123
//get messages from the background script and the popup
124124
chrome.runtime.onMessage.addListener(messageListener);
125125

126-
async function messageListener(request: Message, sender: unknown, sendResponse: (response: MessageResponse) => void): Promise<void> {
126+
function messageListener(request: Message, sender: unknown, sendResponse: (response: MessageResponse) => void): Promise<void> {
127127
//messages from popup script
128128
switch(request.message){
129129
case "update":
@@ -179,8 +179,7 @@ async function messageListener(request: Message, sender: unknown, sendResponse:
179179
submitSponsorTimes();
180180
break;
181181
case "refreshSegments":
182-
await sponsorsLookup(sponsorVideoID, false);
183-
sendResponse({});
182+
sponsorsLookup(sponsorVideoID, false).then(() => sendResponse({}));
184183
break;
185184
}
186185
}

src/popup.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
241241

242242
function onTabs(tabs) {
243243
messageHandler.sendMessage(tabs[0].id, {message: 'getVideoID'}, function(result) {
244+
console.log(result)
244245
if (result !== undefined && result.videoID) {
245246
currentVideoID = result.videoID;
246247
creatingSegment = result.creatingSegment;
@@ -418,21 +419,21 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
418419
const upvoteButton = document.createElement("img");
419420
upvoteButton.id = "sponsorTimesUpvoteButtonsContainer" + UUID;
420421
upvoteButton.className = "voteButton";
421-
upvoteButton.src = chrome.extension.getURL("icons/thumbs_up.svg");
422+
upvoteButton.src = chrome.runtime.getURL("icons/thumbs_up.svg");
422423
upvoteButton.addEventListener("click", () => vote(1, UUID));
423424

424425
const downvoteButton = document.createElement("img");
425426
downvoteButton.id = "sponsorTimesDownvoteButtonsContainer" + UUID;
426427
downvoteButton.className = "voteButton";
427-
downvoteButton.src = chrome.extension.getURL("icons/thumbs_down.svg");
428+
downvoteButton.src = chrome.runtime.getURL("icons/thumbs_down.svg");
428429
downvoteButton.addEventListener("click", () => vote(0, UUID));
429430

430431
//uuid button
431432

432433
const uuidButton = document.createElement("img");
433434
uuidButton.id = "sponsorTimesCopyUUIDButtonContainer" + UUID;
434435
uuidButton.className = "voteButton";
435-
uuidButton.src = chrome.extension.getURL("icons/clipboard.svg");
436+
uuidButton.src = chrome.runtime.getURL("icons/clipboard.svg");
436437
uuidButton.addEventListener("click", () => {
437438
navigator.clipboard.writeText(UUID);
438439
const stopAnimation = utils.applyLoadingAnimation(uuidButton, 0.3);

0 commit comments

Comments
 (0)