Skip to content

Commit

Permalink
Remove response/await call for updateIframeHeight call -
Browse files Browse the repository at this point in the history
With the new synchronously event listener change, places where `await browser.runtime.sendMessage` is called but no response is returned creates a unanswered response.

By removing the await, it can call the func and move on!
  • Loading branch information
rafeerahman authored and maxxcrawford committed Nov 27, 2023
1 parent 1271d1f commit b90b5e3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/js/other-websites/inpage_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ async function populateFreeMaskList(maskList, masks) {
.querySelector(".fx-relay-menu-masks-lists")
?.classList.add("is-visible");

await browser.runtime.sendMessage({
browser.runtime.sendMessage({
method: "updateIframeHeight",
height: document.getElementById("fxRelayMenuBody").scrollHeight,
});
Expand Down Expand Up @@ -276,7 +276,7 @@ async function populatePremiumMaskList(maskList, masks) {
.querySelector(".fx-relay-menu-masks-lists")
?.classList.add("is-visible");

await browser.runtime.sendMessage({
browser.runtime.sendMessage({
method: "updateIframeHeight",
height: document.getElementById("fxRelayMenuBody").scrollHeight,
});
Expand Down Expand Up @@ -488,7 +488,7 @@ const buildContent = {
fxRelayMenuBody.classList.remove("is-premium");
signedInContentFree?.classList.remove("is-hidden");

await browser.runtime.sendMessage({
browser.runtime.sendMessage({
method: "updateIframeHeight",
height: fxRelayMenuBody.scrollHeight,
});
Expand All @@ -509,7 +509,7 @@ const buildContent = {
signedInContentFree?.remove();

// Resize iframe
await browser.runtime.sendMessage({
browser.runtime.sendMessage({
method: "updateIframeHeight",
height: fxRelayMenuBody.scrollHeight,
});
Expand Down Expand Up @@ -640,7 +640,7 @@ const buildContent = {
".fx-relay-menu-generate-alias-btn"
);

await browser.runtime.sendMessage({
browser.runtime.sendMessage({
method: "updateIframeHeight",
height: fxRelayMenuBody.scrollHeight,
});
Expand Down Expand Up @@ -699,7 +699,7 @@ const buildContent = {

// Bug: There's a race condition on how fast to detect the iframe being loaded. The setTimeout solves it for now.
setTimeout(async () => {
await browser.runtime.sendMessage({
browser.runtime.sendMessage({
method: "updateIframeHeight",
height: document.getElementById("fxRelayMenuBody").scrollHeight,
});
Expand Down Expand Up @@ -738,7 +738,7 @@ const buildContent = {
button.classList.add("is-active");

// Resize iframe
await browser.runtime.sendMessage({
browser.runtime.sendMessage({
method: "updateIframeHeight",
height: document.getElementById("fxRelayMenuBody").scrollHeight,
});
Expand Down Expand Up @@ -853,7 +853,7 @@ const buildContent = {
);

// Resize iframe
await browser.runtime.sendMessage({
browser.runtime.sendMessage({
method: "updateIframeHeight",
height: document.getElementById("fxRelayMenuBody").scrollHeight,
});
Expand Down Expand Up @@ -900,7 +900,7 @@ const buildContent = {
});

// Resize iframe
await browser.runtime.sendMessage({
browser.runtime.sendMessage({
method: "updateIframeHeight",
height: document.getElementById("fxRelayMenuBody").scrollHeight,
});
Expand Down

0 comments on commit b90b5e3

Please sign in to comment.