Skip to content

Commit

Permalink
DeviceOrientationControls: Add isSecureContext check. (#21528)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Mar 26, 2021
1 parent 9ce67fa commit 56ca942
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/js/controls/DeviceOrientationControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

THREE.DeviceOrientationControls = function ( object ) {

if ( window.isSecureContext === false ) {

console.error( 'THREE.DeviceOrientationControls: DeviceOrientationEvent is only available in secure contexts (https)' );

}

var scope = this;
var changeEvent = { type: 'change' };
var EPS = 0.000001;
Expand Down
6 changes: 6 additions & 0 deletions examples/jsm/controls/DeviceOrientationControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import {

var DeviceOrientationControls = function ( object ) {

if ( window.isSecureContext === false ) {

console.error( 'THREE.DeviceOrientationControls: DeviceOrientationEvent is only available in secure contexts (https)' );

}

var scope = this;
var changeEvent = { type: 'change' };
var EPS = 0.000001;
Expand Down

0 comments on commit 56ca942

Please sign in to comment.