Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/middleware/wer-middleware.raw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
/* This will be converted into a lodash templ., any */
/* external argument must be provided using it */
/* -------------------------------------------------- */
(function(window) {
(function() {
try{window}catch{var window:any;}

const injectionContext = {browser: null};
(function() {
Expand Down Expand Up @@ -44,7 +45,7 @@
switch (type) {
case SIGN_RELOAD:
logger("Detected Changes. Reloading ...");
reloadPage && window.location.reload();
reloadPage && window?.location.reload();
break;

case SIGN_LOG:
Expand Down Expand Up @@ -118,7 +119,7 @@
switch (type) {
case SIGN_CHANGE:
logger("Detected Changes. Reloading ...");
reloadPage && window.location.reload();
reloadPage && window?.location.reload();
break;

case SIGN_LOG:
Expand All @@ -130,9 +131,9 @@

// ======================= Bootstraps the middleware =========================== //
runtime.reload
? extension.getBackgroundPage() === window ? backgroundWorker(new WebSocket(wsHost)) : extensionPageWorker()
? !window ? backgroundWorker(new WebSocket(wsHost)) : extensionPageWorker()
: contentScriptWorker();
})(window);
})();

/* ----------------------------------------------- */
/* End of Webpack Hot Extension Middleware */
Expand Down