Skip to content

Commit

Permalink
Fix path to options page.
Browse files Browse the repository at this point in the history
- Update options page fallback with path to dist
- Dial down non-fatal error reporting. We already caught it.
  • Loading branch information
olizilla committed Nov 27, 2017
1 parent 6bb77c0 commit 84ed233
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions add-on/src/lib/ipfs-companion.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ try {
onclick: copyAddressAtPublicGw
})
} catch (err) {
console.error('Error creating contextMenus', err)
console.log('[ipfs-companion] Error creating contextMenus', err)
}

function inFirefox () {
Expand Down Expand Up @@ -378,7 +378,7 @@ async function updateContextMenus (changedTabId) {
}
}
} catch (err) {
console.error('Error updating context menus', err)
console.log('[ipfs-companion] Error updating context menus', err)
}
}

Expand Down
8 changes: 7 additions & 1 deletion add-on/src/popup/browser-action/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ module.exports = (state, emitter) => {
})

emitter.on('openPrefs', () => {
browser.runtime.openOptionsPage().then(() => window.close())
browser.runtime.openOptionsPage()
.then(() => window.close())
.catch((err) => {
console.error('runtime.openOptionsPage() failed, opening options page in tab instead.', err)
// brave: fallback to opening options page as a tab.
browser.tabs.create({ url: browser.extension.getURL('dist/options/options.html') })
})
})

emitter.on('toggleRedirect', async () => {
Expand Down

0 comments on commit 84ed233

Please sign in to comment.