mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: support minimum_chrome_version manifest key (#39357)
feat: support minimum_chrome_version extension key Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -69,6 +69,25 @@ describe('chrome extensions', () => {
|
||||
`)).to.eventually.have.property('id');
|
||||
});
|
||||
|
||||
it('supports minimum_chrome_version manifest key', async () => {
|
||||
const customSession = session.fromPartition(`persist:${require('uuid').v4()}`);
|
||||
const w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
session: customSession,
|
||||
sandbox: true
|
||||
}
|
||||
});
|
||||
|
||||
await w.loadURL('about:blank');
|
||||
|
||||
const extPath = path.join(fixtures, 'extensions', 'chrome-too-low-version');
|
||||
const load = customSession.loadExtension(extPath);
|
||||
await expect(load).to.eventually.be.rejectedWith(
|
||||
`Loading extension at ${extPath} failed with: This extension requires Chromium version 999 or greater.`
|
||||
);
|
||||
});
|
||||
|
||||
it('can open WebSQLDatabase in a background page', async () => {
|
||||
const customSession = session.fromPartition(`persist:${require('uuid').v4()}`);
|
||||
const w = new BrowserWindow({ show: false, webPreferences: { session: customSession, sandbox: true } });
|
||||
|
||||
1
spec/fixtures/extensions/chrome-too-low-version/main.js
vendored
Normal file
1
spec/fixtures/extensions/chrome-too-low-version/main.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
document.documentElement.style.backgroundColor = 'blue';
|
||||
14
spec/fixtures/extensions/chrome-too-low-version/manifest.json
vendored
Normal file
14
spec/fixtures/extensions/chrome-too-low-version/manifest.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "chrome-too-low-version",
|
||||
"version": "1.0",
|
||||
"minimum_chrome_version": "999",
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["<all_urls>"],
|
||||
"js": ["main.js"],
|
||||
"run_at": "document_start"
|
||||
}
|
||||
],
|
||||
"permissions": ["storage"],
|
||||
"manifest_version": 3
|
||||
}
|
||||
Reference in New Issue
Block a user