Skip to content

Instantly share code, notes, and snippets.

@dotproto dotproto/LICENSE
Created Nov 15, 2019

Embed
What would you like to do?
Minimal working Manifest V3 extension.
// Copyright 2019 Google LLC.
// SPDX-License-Identifier: Apache-2.0
chrome.browserAction.onClicked.addListener(handleBrowserActionClicked)
function handleBrowserActionClicked(tab) {
const opts = {
url: chrome.runtime.getURL('popup.html')
};
chrome.windows.create(opts, handleWindowCreated);
}
function handleWindowCreated(window) {
console.log('done');
}
Copyright 2019 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{
"name": "Basic MV3 Demo",
"version": "0.1.0",
"manifest_version": 3,
"background": {
"service_worker": "background.js"
},
"browser_action": {
"default_title": "Click me to open a new window"
}
}
<!DOCTYPE html>
<html lang="en">
<!--
Copyright 2019 Google LLC.
SPDX-License-Identifier: Apache-2.0
-->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h2>Hello, world!</h2>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.