From 4dbce54595679fee88fb784e718c15906f32d3aa Mon Sep 17 00:00:00 2001 From: jbidad Date: Fri, 22 Oct 2021 19:11:56 +0330 Subject: [PATCH] Change 'update page URL' to 'open in new tab' --- src/gen/index.bundle.js | 4 ++-- src/gen/index.bundle.js.map | 2 +- src/self/ts/index.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gen/index.bundle.js b/src/gen/index.bundle.js index daa4734..2c68d51 100644 --- a/src/gen/index.bundle.js +++ b/src/gen/index.bundle.js @@ -87,7 +87,7 @@ chrome.browserAction.onClicked.addListener(() => { } } /* 置換後のURLにアクセス */ - chrome.tabs.update({ url: newUrl }); + chrome.tabs.create({ url: newUrl }); }); }); }); @@ -96,4 +96,4 @@ chrome.browserAction.onClicked.addListener(() => { /***/ }) /******/ }); -//# sourceMappingURL=index.bundle.js.map \ No newline at end of file +//# sourceMappingURL=index.bundle.js.map diff --git a/src/gen/index.bundle.js.map b/src/gen/index.bundle.js.map index ee4d904..2082ba2 100644 --- a/src/gen/index.bundle.js.map +++ b/src/gen/index.bundle.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap ac225006bbdb16a71722?c234*","webpack:///./src/self/ts/index.ts"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;AChEA,mBAAmB;AACnB,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC;IACvC,kBAAkB;IAClB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAC,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,EAAE,CAAC,IAAI;QACxD,YAAY;QACZ,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAgB;YACrC,MAAM,WAAW,GAAa,QAAQ,CAAC,UAAU,CAAC,CAAC;YACnD,cAAc;YACd,IAAI,MAAM,GAAW,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;YACjC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC,CAAC;gBACjD,MAAM,OAAO,GAAW,WAAW,CAAC,CAAC,CAAC,CAAC;gBACvC,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC,EAAC;oBAC7B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC7E,CAAC;YACL,CAAC;YACD,kBAAkB;YAClB,MAAM,CAAC,IAAI,CAAC,MAAM,CACd,EAAC,GAAG,EAAE,MAAM,EAAC,CAChB,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","file":"index.bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ac225006bbdb16a71722","/* 拡張機能アイコンクリック時 */\r\nchrome.browserAction.onClicked.addListener((): void => {\r\n /* アクティブタブの情報取得 */\r\n chrome.tabs.query({currentWindow: true, active: true}, (tabs): void => {\r\n /* 置換設定取得 */\r\n chrome.storage.sync.get((getItems: object): void => {\r\n const getSettings: object[] = getItems[\"settings\"];\r\n /* 置換用URL作成 */\r\n let newUrl: string = tabs[0].url;\r\n for (let i: number = 0; i < getSettings.length; i++){\r\n const setting: object = getSettings[i];\r\n if (setting[\"enabled\"] === true){\r\n newUrl = newUrl.replace(new RegExp(setting[\"before\"]), setting[\"after\"]);\r\n }\r\n }\r\n /* 置換後のURLにアクセス */\r\n chrome.tabs.update(\r\n {url: newUrl}\r\n );\r\n });\r\n });\r\n});\n\n\n// WEBPACK FOOTER //\n// ./src/self/ts/index.ts"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap ac225006bbdb16a71722?c234*","webpack:///./src/self/ts/index.ts"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;AChEA,mBAAmB;AACnB,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC;IACvC,kBAAkB;IAClB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAC,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,EAAE,CAAC,IAAI;QACxD,YAAY;QACZ,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAgB;YACrC,MAAM,WAAW,GAAa,QAAQ,CAAC,UAAU,CAAC,CAAC;YACnD,cAAc;YACd,IAAI,MAAM,GAAW,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;YACjC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC,CAAC;gBACjD,MAAM,OAAO,GAAW,WAAW,CAAC,CAAC,CAAC,CAAC;gBACvC,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC,EAAC;oBAC7B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC7E,CAAC;YACL,CAAC;YACD,kBAAkB;YAClB,MAAM,CAAC,IAAI,CAAC,MAAM,CACd,EAAC,GAAG,EAAE,MAAM,EAAC,CAChB,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","file":"index.bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ac225006bbdb16a71722","/* 拡張機能アイコンクリック時 */\r\nchrome.browserAction.onClicked.addListener((): void => {\r\n /* アクティブタブの情報取得 */\r\n chrome.tabs.query({currentWindow: true, active: true}, (tabs): void => {\r\n /* 置換設定取得 */\r\n chrome.storage.sync.get((getItems: object): void => {\r\n const getSettings: object[] = getItems[\"settings\"];\r\n /* 置換用URL作成 */\r\n let newUrl: string = tabs[0].url;\r\n for (let i: number = 0; i < getSettings.length; i++){\r\n const setting: object = getSettings[i];\r\n if (setting[\"enabled\"] === true){\r\n newUrl = newUrl.replace(new RegExp(setting[\"before\"]), setting[\"after\"]);\r\n }\r\n }\r\n /* 置換後のURLにアクセス */\r\n chrome.tabs.create(\r\n {url: newUrl}\r\n );\r\n });\r\n });\r\n});\n\n\n// WEBPACK FOOTER //\n// ./src/self/ts/index.ts"],"sourceRoot":""} diff --git a/src/self/ts/index.ts b/src/self/ts/index.ts index f02d449..62df1f3 100644 --- a/src/self/ts/index.ts +++ b/src/self/ts/index.ts @@ -14,9 +14,9 @@ chrome.browserAction.onClicked.addListener((): void => { } } /* 置換後のURLにアクセス */ - chrome.tabs.update( + chrome.tabs.create( {url: newUrl} ); }); }); -}); \ No newline at end of file +});