Skip to content

Commit

Permalink
Fix for FF58 bug #1402110
Browse files Browse the repository at this point in the history
Bundled page loaded using browser.windows.create
won't show contents unless resized.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1402110
  • Loading branch information
lidel committed Feb 20, 2018
1 parent da56ab9 commit f9b60ff
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions add-on/src/lib/ipfs-proxy/request-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ function createRequestAccess (browser, screen) {
const top = Math.round(((screen.width / 2) - (width / 2)) + currentWin.left)
const left = Math.round(((screen.height / 2) - (height / 2)) + currentWin.top)

const { tabs } = await browser.windows.create({ url, width, height, top, left, type: 'popup' })
const dialogWindow = await browser.windows.create({ url, width, height, top, left, type: 'popup' })
const dialogTabId = dialogWindow.tabs[0].id
// Fix for Fx57 bug where bundled page loaded using
// browser.windows.create won't show contents unless resized.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1402110
await browser.windows.update(dialogWindow.id, {width: dialogWindow.width + 1})

This comment has been minimized.

Copy link
@alanshaw

alanshaw Feb 20, 2018

Member

🙄 👍


// Resolves with { allow, wildcard }
const userResponse = getUserResponse(tabs[0].id, scope, permission, opts)
const userResponse = getUserResponse(dialogTabId, scope, permission, opts)
// Never resolves, might reject if user closes the tab
const userTabRemoved = getUserTabRemoved(tabs[0].id, scope, permission)
const userTabRemoved = getUserTabRemoved(dialogTabId, scope, permission)

let response

Expand All @@ -35,7 +40,7 @@ function createRequestAccess (browser, screen) {
userResponse.destroy()
}

await browser.tabs.remove(tabs[0].id)
await browser.tabs.remove(dialogTabId)

return response
}
Expand Down

0 comments on commit f9b60ff

Please sign in to comment.