Skip to content

Commit 2b91f6b

Browse files
authored
Merge pull request #41 from skibum3d/master
Apply 'enumerable fix' to photon-browser.js; update ShowReel/main.js to work with electron >= 5.0.0.
2 parents f4b2ab7 + bc13d7a commit 2b91f6b

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

ShowReel/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ electron.app.on("ready", function() {
66
height: 720,
77
titleBarStyle: "hidden",
88
webPreferences: {
9-
experimentalFeatures: true
9+
experimentalFeatures: true,
10+
nodeIntegration: true
1011
}
1112
});
1213
window.loadURL("file://" + __dirname + "/index.html");

photon-browser.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,15 +2304,18 @@ Object.defineProperty(Array.prototype, "last", {
23042304
return this.lastFrom(0);
23052305
}
23062306
});
2307-
Object.prototype.keyFromValue = function(value) {
2308-
for (var key in this) {
2309-
if (this.hasOwnProperty(key)) {
2310-
if (this[key] === value) {
2311-
return key;
2307+
Object.defineProperty(Object.prototype, 'keyFromValue', {
2308+
enumerable: false,
2309+
value: function (value) {
2310+
for (var key in this) {
2311+
if (this.hasOwnProperty(key)) {
2312+
if (this[key] === value) {
2313+
return key;
2314+
}
23122315
}
23132316
}
23142317
}
2315-
};
2318+
});
23162319
Array.prototype.indexOfKey = function(value, key, start = 0) {
23172320
for (var i = start; i < this.length; i++) {
23182321
if (this[i][key] === value) {
@@ -2329,9 +2332,12 @@ Math.roundDeep = function(number, deepness = 0) {
23292332
const multi = Math.pow(10, deepness);
23302333
return Math.round(number * multi) / multi;
23312334
};
2332-
Object.prototype.fillDefaults = function(defaults) {
2333-
return module.exports.objFillDefaults(this, defaults);
2334-
};
2335+
Object.defineProperty(Object.prototype, 'fillDefaults', {
2336+
enumerable: false,
2337+
value: function (defaults) {
2338+
return module.exports.objFillDefaults(this, defaults);
2339+
}
2340+
});
23352341

23362342
},{}],42:[function(require,module,exports){
23372343
(function (process,__dirname){

0 commit comments

Comments
 (0)