Skip to content

Commit

Permalink
Generalize https redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
codefrau committed Nov 24, 2015
1 parent 8b94c87 commit b66d67a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 0 additions & 4 deletions etoys/etoys.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
* THE SOFTWARE.
*/

// KLUDGE until freudenbergs.de supports https:
if (location.protocol == 'https:')
location.protocol = 'http:';

var fullscreen = navigator.standalone;

window.onload = function() {
Expand Down
4 changes: 0 additions & 4 deletions scratch/scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
* THE SOFTWARE.
*/

// KLUDGE until freudenbergs.de supports https:
if (location.protocol == 'https:')
location.protocol = 'http:';

var fullscreen = navigator.standalone;

window.onload = function() {
Expand Down
5 changes: 5 additions & 0 deletions squeak.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,11 @@ SqueakJS.runSqueak = function(imageUrl, canvas, options) {
processOptions(options);
if (options.image) imageUrl = options.image;
else options.image = imageUrl;
if (imageUrl.match(/^http:/) && location.protocol == 'https:') {
location.protocol == 'http:';
alert('Redirecting to "http:" for fetching "' + imageUrl + '"');
return
}
SqueakJS.options = options;
SqueakJS.appName = options.appName || imageUrl.replace(/.*\//, "").replace(/\.image$/, "");
Squeak.fsck();
Expand Down

0 comments on commit b66d67a

Please sign in to comment.