From 54ab65989df3a6ecb354f75cbac4dfddb2eefe16 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 26 Mar 2017 12:02:06 +0300 Subject: [PATCH] Simplify configureCommands; focus an existing tab Instead of isolating the deoptimization trigger: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers --- messaging.js | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/messaging.js b/messaging.js index d7bc98cb..590008be 100644 --- a/messaging.js +++ b/messaging.js @@ -193,18 +193,9 @@ function wildcardAsRegExp(s, flags) { } -// isolate deoptimization trigger: -// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers -// * Functions that contain object literals that contain __proto__, or get or set declarations. -const configureCommands = (() => ({ - get url() { - return navigator.userAgent.includes('OPR') - ? 'opera://settings/configureCommands' - : 'chrome://extensions/configureCommands'; - }, - open: () => { - chrome.tabs.create({ - 'url': configureCommands.url - }); - } -}))(); +const configureCommands = { + url: navigator.userAgent.includes('OPR') + ? 'opera://settings/configureCommands' + : 'chrome://extensions/configureCommands', + open: () => openURL({url: configureCommands.url}), +};