Skip to content

DevTools tab for debugging - #79

Closed
taneltm wants to merge 17 commits into
web-eid:mainfrom
taneltm:WE2-967
Closed

DevTools tab for debugging#79
taneltm wants to merge 17 commits into
web-eid:mainfrom
taneltm:WE2-967

Conversation

@taneltm

@taneltm taneltm commented Jan 28, 2025

Copy link
Copy Markdown
Member

Adds the "Web eID" tab to the browser's DevTools.

Features:

  • Event history between the website, extension and native application.
  • Extension's internal log messages.
  • Option to override extension settings, without needing to compile the extension yourself.
  • Option to allow the http://localhost origin when authenticating and signing

The developer tool is disabled by default and needs to be enabled before it can be used.

Firefox

  1. Open [Menu -> Settings -> Extensions and themes]
    or navigate to the address about:addons
  2. Open the Web eID extension details
  3. Open the "Permissions" tab
  4. Toggle "Extend developer tools to access your data in open tabs"

Chrome

  1. Open [Settings -> Extensions]
    or navigate to the address chrome://extensions/
  2. Open the Web eID extension details
  3. Open "Extension options"
  4. Toggle "Enable developer tools"

Screenshots:
Viewing event sequence and the event objects:
image

Viewing the extension's internal log messages:
image

Overriding the extension settings:
image

Resolves WE2-967
Resolves #40

Comment thread static/views/devtools/panels/webeid-log.js Fixed
Comment thread static/views/devtools/panels/webeid-log.js Fixed
Comment thread static/views/devtools/panels/webeid-log.js Fixed
Comment thread static/views/devtools/panels/webeid-log.js Fixed
Comment thread scripts/build.mjs
@svenzik

svenzik commented Mar 12, 2025

Copy link
Copy Markdown
Contributor

Usability suggestions from chrome testing:

Events tab: Reloading the page does not clear the events. There is no button for clearing them (also tested that clearing log does not clear events).

Log tab: Even though there is clear button, the chrome console, network tools etc is cleared each time page is reloaded. I suggest we follow that principle.

Please also consider, If we clear the log tab on reload, then chrome console has a setting preserve log. Should we have similar setting?

@taneltm

taneltm commented Mar 18, 2025

Copy link
Copy Markdown
Member Author

Hi @svenzik!

Good point about not having the ability to clear the events! I'll add it as soon as I have a moment.

However, not clearing the logs on page reload was intentional.
When working on single-page apps, it does make sense to clear the logs on reload, but on multi-page websites where, after auth or sign, you are navigated to another page, and then it would be good to keep the logs.
I would like to keep the current behaviour as default and maybe add a "clear on reload" option. That might be a tiny bit annoying for the SPA developers, but I think it's less confusing for others.
I'll discuss this topic with the team next week before making any decisions on this. I appreciate your feedback about it and will keep it in mind - maybe it would be good to follow the browser DevTools pattern... 🤔

Thank you for taking the time to test it!

Comment thread src/shared/utils/isLoopbackAddress.ts
Comment thread src/shared/devToolsBridge.ts Outdated
Comment thread src/shared/devToolsBridge.ts Outdated
Comment thread src/shared/devToolsBridge.ts Outdated
Comment thread src/shared/devToolsBridge.ts Outdated
Comment thread src/shared/configManager.ts
taneltm and others added 16 commits November 13, 2025 16:38
Signed-off-by: Tanel Metsar <taneltm@users.noreply.github.com>
Signed-off-by: Tanel Metsar <taneltm@users.noreply.github.com>
Signed-off-by: Tanel Metsar <taneltm@users.noreply.github.com>
…vity

WE2-967

Includes minor cleanup for DevTools related files

Signed-off-by: Tanel Metsar <taneltm@users.noreply.github.com>
WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
…pening Web-eID tab

WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
…r during loading

WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
Co-authored-by: Sten Anderson <scopuli-dev@users.noreply.github.com>
WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
…lar to devtools.js

WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
…urning optional_permissions -> devtools on

WE2-967

Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
Signed-off-by: Mart Somermaa <mrts@users.noreply.github.com>
@@ -0,0 +1,70 @@
/*

@mrts mrts Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unused and does not have .ts extension. It should be used in Browser.ts, see comment below.

*
* @see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onInstalled
*/
onInstalled: {

@mrts mrts Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2b8fabb removed the consent page and added Firefox data_collection_permissions in the manifest instead, so
the runtime onInstalled type became unused and was removed. As onInstalled is not used anywhere in the current branch either, I did not restore onInstalled, OnInstallReason, OnInstalledDetails, and OnInstalledCallback in #102.

Comment thread src/models/Browser.ts
/**
*
*/
storage: Storage;

@mrts mrts Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storage resolves to the DOM localStorage/
sessionStorage type, not the WebExtension storage API. So it compiles, but it is the wrong type. In #102, I added the ExtensionStorage import and changed it from the
DOM Storage type to ExtensionStorage.

@mrts

mrts commented Jun 12, 2026

Copy link
Copy Markdown
Member

Superseded by #102.

@mrts mrts closed this Jun 12, 2026
@mrts mrts mentioned this pull request Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option for Verbose Debug Log Messages (in Production)

4 participants