mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-12-22 12:30:01 +00:00
added back installErrorHandler
This commit is contained in:
parent
f9392c5a96
commit
39dad45b47
@ -1717,7 +1717,27 @@ var qs = (function (a : string[]) {
|
||||
return b;
|
||||
})(window.location.search.substr(1).split('&'));
|
||||
|
||||
function globalErrorHandler(msgevent) {
|
||||
var msg = (msgevent.message || msgevent.error || msgevent)+"";
|
||||
// storage quota full? (Chrome) try to expand it
|
||||
if (msg.indexOf("QuotaExceededError") >= 0) {
|
||||
requestPersistPermission();
|
||||
} else {
|
||||
showErrorAlert([{msg:msg,line:0}]);
|
||||
}
|
||||
}
|
||||
|
||||
// catch errors
|
||||
function installErrorHandler() {
|
||||
window.addEventListener('error', globalErrorHandler);
|
||||
}
|
||||
|
||||
function uninstallErrorHandler() {
|
||||
window.removeEventListener('error', globalErrorHandler);
|
||||
}
|
||||
|
||||
function gotoNewLocation(replaceHistory? : boolean) {
|
||||
uninstallErrorHandler();
|
||||
if (replaceHistory)
|
||||
window.location.replace("?" + $.param(qs));
|
||||
else
|
||||
@ -1809,6 +1829,8 @@ async function startPlatform() {
|
||||
}
|
||||
// start platform and load file
|
||||
replaceURLState();
|
||||
installErrorHandler();
|
||||
installGAHooks();
|
||||
await platform.start();
|
||||
await loadBIOSFromProject();
|
||||
await initProject();
|
||||
@ -1817,7 +1839,6 @@ async function startPlatform() {
|
||||
updateSelector();
|
||||
addPageFocusHandlers();
|
||||
showInstructions();
|
||||
installGAHooks();
|
||||
revealTopBar();
|
||||
}
|
||||
|
||||
@ -1994,6 +2015,7 @@ function _switchToHTTPS() {
|
||||
function redirectToHTTPS() {
|
||||
if (window.location.protocol == 'http:' && window.location.host == '8bitworkshop.com') {
|
||||
if (shouldRedirectHTTPS()) {
|
||||
uninstallErrorHandler();
|
||||
window.location.replace(window.location.href.replace(/^http:/, 'https:'));
|
||||
} else {
|
||||
$("#item_switch_https").click(_switchToHTTPS).show();
|
||||
|
@ -48,17 +48,6 @@ class C64WASMPlatform extends Base6502MachinePlatform<WASMMachine> implements Pl
|
||||
getMemoryMap() { return C64_MEMORY_MAP; }
|
||||
}
|
||||
|
||||
/*
|
||||
class C64WASMPlatform extends BaseWASMPlatform implements Platform {
|
||||
|
||||
prefix = 'c64';
|
||||
|
||||
getPresets() { return C64_PRESETS; }
|
||||
getToolForFilename = getToolForFilename_6502;
|
||||
getOpcodeMetadata = getOpcodeMetadata_6502;
|
||||
getDefaultExtension() { return ".c"; };
|
||||
}
|
||||
*/
|
||||
|
||||
PLATFORMS['c64'] = C64Platform;
|
||||
PLATFORMS['c64'] = C64WASMPlatform;
|
||||
PLATFORMS['c64.wasm'] = C64WASMPlatform;
|
||||
PLATFORMS['c64.js'] = C64Platform;
|
||||
|
Loading…
Reference in New Issue
Block a user