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:
trop[bot]
2023-08-14 10:06:41 +02:00
committed by GitHub
parent ca899eb3cb
commit 5f1ada46f5
6 changed files with 43 additions and 0 deletions

View File

@@ -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 } });

View File

@@ -0,0 +1 @@
document.documentElement.style.backgroundColor = 'blue';

View 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
}