Fix template renderer sandbox compatibility (#770)
* Use Object.prototype.hasOwnProperty.call instead of hasOwn * Disable WebExtension and core.js APIs for template-renderer.js
This commit is contained in:
parent
1cc9f4b1a4
commit
dd8e32e7c4
@ -84,14 +84,20 @@
|
|||||||
},
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["ext/mixed/js/core.js"],
|
"files": [
|
||||||
|
"ext/mixed/js/core.js",
|
||||||
|
"ext/bg/js/template-renderer.js"
|
||||||
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"webextensions": false
|
"webextensions": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["ext/**/*.js"],
|
"files": ["ext/**/*.js"],
|
||||||
"excludedFiles": ["ext/mixed/js/core.js"],
|
"excludedFiles": [
|
||||||
|
"ext/mixed/js/core.js",
|
||||||
|
"ext/bg/js/template-renderer.js"
|
||||||
|
],
|
||||||
"globals": {
|
"globals": {
|
||||||
"errorToJson": "readonly",
|
"errorToJson": "readonly",
|
||||||
"jsonToError": "readonly",
|
"jsonToError": "readonly",
|
||||||
|
@ -43,7 +43,7 @@ class TemplateRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const markerPre = data.marker;
|
const markerPre = data.marker;
|
||||||
const markerPreHas = hasOwn(data, 'marker');
|
const markerPreHas = Object.prototype.hasOwnProperty.call(data, 'marker');
|
||||||
try {
|
try {
|
||||||
this._stateStack = [new Map()];
|
this._stateStack = [new Map()];
|
||||||
data.marker = marker;
|
data.marker = marker;
|
||||||
|
Loading…
Reference in New Issue
Block a user