@polypane/electron-chrome-extensions
Advanced tools
Comparing version 3.15.3 to 3.16.0
@@ -14,2 +14,3 @@ import { ExtensionContext } from '../context'; | ||
private getCurrent; | ||
private getSelected; | ||
private create; | ||
@@ -16,0 +17,0 @@ private insertCSS; |
@@ -101,2 +101,15 @@ /******/ (() => { // webpackBootstrap | ||
}; | ||
function patchWindowOpen() { | ||
// ts-ignore | ||
window.open = function (url, target, windowFeatures) { | ||
//const result = original.apply(this, [url, target, windowFeatures]); | ||
if (typeof url === 'string') { | ||
console.log('Patched window.open'); | ||
chrome.tabs.create({ | ||
url | ||
}); | ||
} | ||
return null; | ||
}; | ||
} | ||
@@ -107,2 +120,21 @@ // Function body to run in the main world. | ||
var _chrome$runtime; | ||
function patchWindowOpen() { | ||
// ts-ignore | ||
window.open = function (url, target, windowFeatures) { | ||
//const result = original.apply(this, [url, target, windowFeatures]); | ||
if (typeof url === 'string') { | ||
console.log('Patched window.open'); | ||
chrome.tabs.create({ | ||
url | ||
}); | ||
} else if (url instanceof URL) { | ||
console.log('Patched window.open'); | ||
chrome.tabs.create({ | ||
url: url.href | ||
}); | ||
} | ||
return null; | ||
}; | ||
} | ||
// Use context bridge API or closure variable when context isolation is disabled. | ||
@@ -112,2 +144,3 @@ const electron = window.electron || electronContext; | ||
const extensionId = (_chrome$runtime = chrome.runtime) === null || _chrome$runtime === void 0 ? void 0 : _chrome$runtime.id; | ||
patchWindowOpen(); | ||
@@ -347,2 +380,3 @@ // NOTE: This uses a synchronous IPC to get the extension manifest. | ||
getCurrent: invokeExtension('tabs.getCurrent'), | ||
getSelected: invokeExtension('tabs.getSelected'), | ||
getAllInWindow: invokeExtension('tabs.getAllInWindow'), | ||
@@ -349,0 +383,0 @@ insertCSS: invokeExtension('tabs.insertCSS'), |
{ | ||
"name": "@polypane/electron-chrome-extensions", | ||
"version": "3.15.3", | ||
"version": "3.16.0", | ||
"description": "Chrome extension support for Electron", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -331,2 +331,3 @@ # electron-chrome-extensions | ||
- [x] chrome.tabs.getCurrent | ||
- [x] chrome.tabs.getSelected | ||
- [x] chrome.tabs.connect | ||
@@ -333,0 +334,0 @@ - [x] chrome.tabs.sendMessage |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5103
410
483448
31