Skip to content

Commit 8b5a222

Browse files
committed
Prefer ?explorer search param over .deth.net prefix
1 parent 1b9a198 commit 8b5a222

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/vscode-host/src/deth/commands/ethViewerCommands.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ export const ethViewerCommands = {
1919
getApiName: (): string | undefined => {
2020
const { hostname } = window.location;
2121

22+
const searchParam = new URLSearchParams(window.location.search).get(
23+
"explorer"
24+
);
25+
26+
if (searchParam) return searchParam;
27+
2228
// @todo this can be deprecated after we deploy and configure iframe entrypoints
2329
if (hostname.endsWith(".deth.net")) return hostname.slice(0, -9);
2430

25-
return (
26-
new URLSearchParams(window.location.search).get("explorer") || undefined
27-
);
31+
return undefined;
2832
},
2933
openRepoOnGithub: () => {
3034
window.open("https://github.com/dethcrypto/ethereum-code-viewer", "_blank");

0 commit comments

Comments
 (0)