Delete global.Buffer in preload script

http://electron.atom.io/docs/tutorial/security/#buffer-global
This commit is contained in:
Yuya Ochiai 2017-01-25 23:24:15 +09:00
parent da64cec869
commit 83a9d21d34

View file

@ -8,6 +8,8 @@ window.eval = global.eval = () => {
throw new Error('Sorry, Mattermost does not support window.eval() for security reasons.'); throw new Error('Sorry, Mattermost does not support window.eval() for security reasons.');
}; };
Reflect.deleteProperty(global.Buffer); // http://electron.atom.io/docs/tutorial/security/#buffer-global
function hasClass(element, className) { function hasClass(element, className) {
var rclass = /[\t\r\n\f]/g; var rclass = /[\t\r\n\f]/g;
if ((' ' + element.className + ' ').replace(rclass, ' ').indexOf(className) > -1) { if ((' ' + element.className + ' ').replace(rclass, ' ').indexOf(className) > -1) {