Skip to content

Commit

Permalink
fix: Don't request clipboardWrite permission for Chromium browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
birtles committed Jun 17, 2021
1 parent 1d34cd4 commit 787da9c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.5.13 (2021-06-17)

- Drop `clipboardWrite` property from Chromium manifest since it's not needed
there.

## 0.5.12 (2021-06-17)

- Fix some bugs in the lookup cache
Expand Down
2 changes: 2 additions & 0 deletions manifest.json.src
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
},
/*#endif*/
"permissions": [
/*#if needs_clipboard_write*/
"clipboardWrite",
/*#endif*/
"contextMenus",
"storage",
"tabs",
Expand Down
7 changes: 7 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ if (process.env.RELEASE_BUILD && process.env.BUGSNAG_API_KEY) {
const chromeConfig = buildExtConfig({
distFolder: 'dist-chrome',
includeChromeWebStoreIcons: true,
needsClipboardWrite: false,
supportsChromeStyle: true,
supportsMatchAboutBlank: true,
target: 'chromium',
Expand All @@ -144,6 +145,7 @@ const chromeConfig = buildExtConfig({
const edgeConfig = buildExtConfig({
distFolder: 'dist-edge',
includeChromeWebStoreIcons: true,
needsClipboardWrite: false,
supportsMatchAboutBlank: true,
target: 'chromium',
usesEdgeStore: true,
Expand All @@ -165,6 +167,7 @@ module.exports = (env) => {
function buildExtConfig({
distFolder,
includeChromeWebStoreIcons = false,
needsClipboardWrite = true,
supportsAlphaVersion = false,
supportsApplicationsField = false,
supportsBrowserStyle = false,
Expand All @@ -175,6 +178,10 @@ function buildExtConfig({
usesEdgeStore = false,
}) {
const preprocessorFeatures = [];
if (needsClipboardWrite) {
preprocessorFeatures.push('needs_clipboard_write');
}

if (supportsAlphaVersion) {
preprocessorFeatures.push('supports_alpha_version');
}
Expand Down

0 comments on commit 787da9c

Please sign in to comment.