Skip to content

Commit

Permalink
Go straight to SharedJSContext into console button
Browse files Browse the repository at this point in the history
  • Loading branch information
PartyWumpus committed May 4, 2023
1 parent 5e440d6 commit 0786418
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/src/components/settings/pages/developer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@ export default function DeveloperSettings() {
description={<span style={{ whiteSpace: 'pre-line' }}>{t('SettingsDeveloperIndex.cef_console.desc')}</span>}
icon={<FaTerminal style={{ display: 'block' }} />}
>
<DialogButton onClick={() => Navigation.NavigateToExternalWeb(`localhost:8080`)}>
<DialogButton onClick={async () => {
let res = (await window.DeckyPluginLoader.callServerMethod('get_tab_id', { "name": "SharedJSContext" }));
if (res.success) {
console.log(res.result);
Navigation.NavigateToExternalWeb("localhost:8080/devtools/inspector.html?ws=localhost:8080/devtools/page/"+res.result);
} else {
console.error('Unable to find ID for SharedJSContext tab ', res.result);
Navigation.NavigateToExternalWeb("localhost:8080");
}
}}>
{t('SettingsDeveloperIndex.cef_console.button')}
</DialogButton>
</Field>
Expand Down

0 comments on commit 0786418

Please sign in to comment.