Skip to content

Commit

Permalink
feat: support both 'ws' and 'wss' ER bindings (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
rentallect authored May 26, 2023
1 parent e9056bf commit 2bba4d0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"dependencies": {
"@auth0/auth0-spa-js": "^2.0.4",
"@babel/runtime": "^7.17.9",
"@openziti/ziti-browzer-core": "^0.22.0",
"@openziti/ziti-browzer-core": "^0.23.0",
"bowser": "^2.11.0",
"cookie-interceptor": "^1.0.0",
"core-js": "^3.22.8",
Expand Down
30 changes: 12 additions & 18 deletions src/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,14 +498,11 @@ class ZitiBrowzerRuntime {
e.preventDefault();
window.zitiBrowzerRuntime.toastSuccess(`New logLevel of '${loglevelValue}' now in effect`);
window.zitiBrowzerRuntime.hotKeyModal.close();
window.zitiBrowzerRuntime.toastWarning(`Page will reload in 5 seconds...`);
window.zitiBrowzerRuntime.toastWarning(`Page will now reload...`);
setTimeout(function() {
window.zitiBrowzerRuntime.wb.messageSW({
type: 'UNREGISTER',
payload: {
}
});
}, 3000);
zitiBrowzerRuntime.logger.debug(`################ doing page reload now ################`);
window.location.replace('https://' + zitiBrowzerRuntime.zitiConfig.httpAgent.self.host + zitiBrowzerRuntime.zitiConfig.httpAgent.target.path);
}, 2000);
}

/**
Expand Down Expand Up @@ -901,7 +898,7 @@ if (isUndefined(window.zitiBrowzerRuntime)) {
*/
let initResults = await zitiBrowzerRuntime.initialize({loadedViaHTTPAgent: (loadedViaHTTPAgent ? true : false)});

console.log('returned from call to zitiBrowzerRuntime.initialize');
console.log('returned from call to zitiBrowzerRuntime.initialize -- initResults:', initResults);

if (initResults.authenticated && !initResults.loadedViaHTTPAgent) {

Expand Down Expand Up @@ -1264,17 +1261,14 @@ if (isUndefined(window.zitiBrowzerRuntime)) {
HotKey: '<strong>${window.zitiBrowzerRuntime.hotKey}</strong>'
`);

}

/**
* If the ZBR was loaded via a SW bootstrap, then reload the page to complete the bootstrap cycle
*/
if (loadedViaSWBootstrap) {
// setTimeout(function() {
zitiBrowzerRuntime.logger.debug(`################ loadedViaSWBootstrap detected -- doing page reload now ################`);
window.location.reload();
// }, 300);
}

/**
* If the ZBR was loaded via a SW bootstrap, then reload the page to complete the bootstrap cycle
*/
if (loadedViaSWBootstrap) {
zitiBrowzerRuntime.logger.debug(`################ loadedViaSWBootstrap detected -- doing page reload now ################`);
window.location.reload();
}

setTimeout(window.zitiBrowzerRuntime._zbrPing, 1000, window.zitiBrowzerRuntime );
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1183,10 +1183,10 @@
"@types/emscripten" "^1.39.6"
"@wasmer/wasi" "^1.0.2"

"@openziti/ziti-browzer-core@^0.22.0":
version "0.22.0"
resolved "https://registry.yarnpkg.com/@openziti/ziti-browzer-core/-/ziti-browzer-core-0.22.0.tgz#d8fa7f50368558a61e0fcefe7df0f6e115c4f5e0"
integrity sha512-qyhzVEx4DTxQcg7/OYC9raDRGBF0iEdNzH1pd8yLpLkCY9HOQ8ez2E7GwtL1T/nTqlrjgNRtpjeAVt9g+YH67A==
"@openziti/ziti-browzer-core@^0.23.0":
version "0.23.0"
resolved "https://registry.yarnpkg.com/@openziti/ziti-browzer-core/-/ziti-browzer-core-0.23.0.tgz#8f4091fcd3d30381ca66d7cb4ae281f732ca5e73"
integrity sha512-1GngFrEF2llEkYRLyUXCgNQI46/cDC0KsB5T66UtWtYC+7Bb7dHDdipDzFsYl8dj+UDyh2G+GwrDTszDGU5yxg==
dependencies:
"@openziti/libcrypto-js" "^0.14.1"
"@openziti/ziti-browzer-edge-client" "^0.6.0"
Expand Down

0 comments on commit 2bba4d0

Please sign in to comment.