kopia lustrzana https://github.com/backface/turtlestitch
Added guard against non-SSL access
rodzic
c9885ad5b1
commit
075d9c2d3a
24
objects.js
24
objects.js
|
@ -8758,6 +8758,20 @@ CamSnapshotDialogMorph.prototype.buildContents = function () {
|
|||
this.drawNew();
|
||||
};
|
||||
|
||||
CamSnapshotDialogMorph.prototype.popUp = function (world) {
|
||||
CamSnapshotDialogMorph.uber.popUp.call(this, world);
|
||||
|
||||
if (location.protocol === 'http:') {
|
||||
this.ide.inform(
|
||||
'SSL Error',
|
||||
'Due to browser security policies, you need to\n' +
|
||||
'access Snap! through HTTPS to use the camera.\n\n' +
|
||||
'Plase replace the "http://" part of the address\n' +
|
||||
'in your browser by "https://" and try again.');
|
||||
this.destroy();
|
||||
}
|
||||
};
|
||||
|
||||
CamSnapshotDialogMorph.prototype.ok = function () {
|
||||
var stage = this.ide.stage,
|
||||
canvas = newCanvas(stage.dimensions);
|
||||
|
@ -8775,11 +8789,17 @@ CamSnapshotDialogMorph.prototype.ok = function () {
|
|||
);
|
||||
|
||||
this.accept(new Costume(canvas), this.sprite.newCostumeName('camera'));
|
||||
CamSnapshotDialogMorph.uber.destroy.call(this);
|
||||
this.close();
|
||||
};
|
||||
|
||||
CamSnapshotDialogMorph.prototype.destroy = function () {
|
||||
this.videoElement.remove();
|
||||
this.oncancel.call(this);
|
||||
this.close();
|
||||
};
|
||||
|
||||
CamSnapshotDialogMorph.prototype.close = function () {
|
||||
if (this.videoElement) {
|
||||
this.videoElement.remove();
|
||||
}
|
||||
CamSnapshotDialogMorph.uber.destroy.call(this);
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue