Skip to content

Commit

Permalink
chore: allow disabling browser sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
VerteDinde committed Feb 8, 2022
1 parent 49da95d commit 3d0e0e4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const common = require('electron-installer-common')
const fs = require('fs-extra')
const { merge, pull } = require('lodash')
const path = require('path')
const semver = require('semver')
const { spawn } = require('@malept/cross-spawn-promise')
const which = require('which')
const yaml = require('js-yaml')
Expand Down Expand Up @@ -155,9 +154,6 @@ class SnapcraftYAML {
}

transformFeatures () {
if (semver.satisfies(this.electronVersion, '>= 5.0.0') && !this.features.browserSandbox) {
this.features.browserSandbox = true
}
for (const feature of Object.keys(this.features)) {
this.transformFeature(feature)
}
Expand Down
6 changes: 0 additions & 6 deletions test/yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ test('browserSandbox feature', async t => {
t.deepEqual(plugs['browser-sandbox'], { interface: 'browser-support', 'allow-sandbox': true }, 'browser-sandbox plug exists')
})

test('browserSandbox is always on for Electron >= 5.0.0', async t => {
const { apps } = await createYaml(t, { name: 'electronAppName' }, '5.0.0')
util.assertNotIncludes(t, apps.electronAppName.plugs, 'browser-support', 'browser-support is not in app plugs')
util.assertIncludes(t, apps.electronAppName.plugs, 'browser-sandbox', 'browser-sandbox is in app plugs')
})

test('browserSandbox feature with custom plugs', async t => {
const { apps, plugs } = await createYaml(t, { name: 'electronAppName', appPlugs: ['foobar'], features: { browserSandbox: true }, plugs: { foobar: { interface: 'dbus', name: 'com.example.foobar' } } })
util.assertIncludes(t, apps.electronAppName.plugs, 'browser-sandbox', 'browser-sandbox is in app plugs')
Expand Down

0 comments on commit 3d0e0e4

Please sign in to comment.