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": [
|
||||
{
|
||||
"files": ["ext/mixed/js/core.js"],
|
||||
"files": [
|
||||
"ext/mixed/js/core.js",
|
||||
"ext/bg/js/template-renderer.js"
|
||||
],
|
||||
"env": {
|
||||
"webextensions": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["ext/**/*.js"],
|
||||
"excludedFiles": ["ext/mixed/js/core.js"],
|
||||
"excludedFiles": [
|
||||
"ext/mixed/js/core.js",
|
||||
"ext/bg/js/template-renderer.js"
|
||||
],
|
||||
"globals": {
|
||||
"errorToJson": "readonly",
|
||||
"jsonToError": "readonly",
|
||||
|
@ -43,7 +43,7 @@ class TemplateRenderer {
|
||||
}
|
||||
|
||||
const markerPre = data.marker;
|
||||
const markerPreHas = hasOwn(data, 'marker');
|
||||
const markerPreHas = Object.prototype.hasOwnProperty.call(data, 'marker');
|
||||
try {
|
||||
this._stateStack = [new Map()];
|
||||
data.marker = marker;
|
||||
|
Loading…
Reference in New Issue
Block a user