Skip to content

Commit

Permalink
fix: change of openTabListWhenNewTab take effect immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
cnwangjie committed Oct 4, 2018
1 parent 72b4fa2 commit 838431e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ const updateBrowserAction = (action, tmp = false) => {
const {label} = _.find(items, {value: action})
console.log('action is: ', action, 'set title as: ', label)
browser.browserAction.setTitle({title: label})
/* eslint-disable-next-line */
window.coverBrowserAction = () => {}
if (action === 'popup') {
browser.browserAction.setPopup({popup: 'index.html#/popup'})
/* eslint-disable-next-line */
window.coverBrowserAction = () => {}
} else {
browser.browserAction.setPopup({popup: ''})
window.browswerActionClickedHandler = getBrowserActionHandler(action)
Expand Down Expand Up @@ -76,7 +76,6 @@ const dynamicDisableMenu = async () => {
})
browser.contextMenus.update('STORE.STORE_ALL_TABS_IN_ALL_WINDOWS', {
enabled: windows.length > 1,
title: __('menu_STORE_ALL_TABS_IN_ALL_WINDOWS') + ` (${groupedTabs.all.length})`,
})
browser.contextMenus.update('STORE.STORE_ALL_TABS_IN_CURRENT_WINDOW', {
title: __('menu_STORE_ALL_TABS_IN_CURRENT_WINDOW') + ` (${groupedTabs.all.length})`,
Expand Down Expand Up @@ -221,7 +220,7 @@ const init = async () => {
if (msg.optionsChanged) {
const changes = msg.optionsChanged
console.log(changes)
Object.assign(opts, changes)
Object.assign(window.opts, changes)
if (changes.browserAction) updateBrowserAction(changes.browserAction)
if (('pageContext' in changes) || ('allContext' in changes)) await setupContextMenus(changes)
await browser.runtime.sendMessage({optionsChangeHandledStatus: 'success'})
Expand Down
11 changes: 9 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"

cross-env@^5.2.0:
version "5.2.0"
resolved "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
dependencies:
cross-spawn "^6.0.5"
is-windows "^1.0.0"

cross-spawn@^3.0.0:
version "3.0.1"
resolved "http://registry.npm.taobao.org/cross-spawn/download/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
Expand Down Expand Up @@ -3659,9 +3666,9 @@ is-utf8@^0.2.0:
version "0.2.1"
resolved "http://registry.npm.taobao.org/is-utf8/download/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"

is-windows@^1.0.1, is-windows@^1.0.2:
is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2:
version "1.0.2"
resolved "http://registry.npm.taobao.org/is-windows/download/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"

[email protected]:
version "0.0.1"
Expand Down

0 comments on commit 838431e

Please sign in to comment.