polkadot-js / extension

Simple browser extension for managing Polkadot and Substrate network accounts in a browser. Allows the signing of extrinsics using these accounts. Also provides a simple interface for compliant extensions for dapps.
Apache License 2.0
972 stars 409 forks source link

the popup url was different from the website url #1211

Closed jasonintju closed 1 year ago

jasonintju commented 1 year ago
jacogr commented 1 year ago

The extension only keeps track of the initial URL where the script was injected, as per Chrome messaging. Basically this is on the messaging port of the comms channel between the page and the extension background. The port/url is assigned when the listener is started.

See

https://github.com/polkadot-js/extension/blob/b2fe69e6564f9f2e5bf7143097bf2f2f7e6cb2f5/packages/extension-base/src/background/handlers/index.ts#L17-L24

The extension UI will always display the same URL as retrieved from the page itself by the background handler since that is the actual location the request for authorization was made from, aka the actual message to request was sent from that specific location, hence being available on the chrome messaging object.

jacogr commented 1 year ago

Closing, question answered.

polkadot-js-bot commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.