Keeps the expression when popping out a debug visualizer view.
This commit is contained in:
@@ -72,12 +72,18 @@ export class ConnectionHandler {
|
||||
openInBrowser: async ({}) => {
|
||||
throwIfNotAuthenticated();
|
||||
|
||||
const url = server.getIndexUrl({
|
||||
expression: this.watcher
|
||||
? this.watcher.expression
|
||||
: undefined,
|
||||
});
|
||||
|
||||
let opened = false;
|
||||
if (config.useChromeKioskMode()) {
|
||||
opened = await launchChrome(server.indexUrl);
|
||||
opened = await launchChrome(url);
|
||||
}
|
||||
if (!opened) {
|
||||
open(server.indexUrl);
|
||||
open(url);
|
||||
}
|
||||
},
|
||||
setPreferredDataExtractor: async ({ dataExtractorId }) => {
|
||||
|
||||
@@ -28,9 +28,13 @@ export class Server {
|
||||
});
|
||||
}
|
||||
|
||||
public get indexUrl(): string {
|
||||
public getIndexUrl(args: { expression?: string } = {}): string {
|
||||
const port = process.env.USE_DEV_UI ? 8080 : this.port;
|
||||
return `http://localhost:${port}/index.html?serverPort=${this.port}&serverSecret=${this.secret}`;
|
||||
const expr =
|
||||
args.expression !== undefined
|
||||
? `&expression=${encodeURIComponent(args.expression)}`
|
||||
: "";
|
||||
return `http://localhost:${port}/index.html?serverPort=${this.port}&serverSecret=${this.secret}${expr}`;
|
||||
}
|
||||
|
||||
public get mainBundleUrl(): string {
|
||||
|
||||
@@ -89,7 +89,7 @@ export function getHtml(server: Server) {
|
||||
</script>
|
||||
${
|
||||
isDev
|
||||
? `<iframe sandbox="allow-top-navigation allow-scripts allow-same-origin allow-popups allow-pointer-lock allow-forms" src="${server.indexUrl}"></iframe>`
|
||||
? `<iframe sandbox="allow-top-navigation allow-scripts allow-same-origin allow-popups allow-pointer-lock allow-forms" src="${server.getIndexUrl()}"></iframe>`
|
||||
: `<script type="text/javascript" src="${server.mainBundleUrl}"></script>`
|
||||
}
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user