alpha-wallet-android
alpha-wallet-android copied to clipboard
Fix: URL shown in dapp browser not tracking changes if the site uses History API to change location
https://autographnft.io is a good example
Hi @ChintanRathod I couldn't determine how to intercept the page change here in my initial check; can you take a look and see if there's a way to receive the page change.
To reproduce:
visit https://autographnft.io in the dapp browser
On the page, click on the hamburger menu and switch to a different page eg 'Offers Received' or 'Profile' etc.
Notice that the URL text doesn't update, because there's currently no hook for the update. I presume the site uses React or some other framework.
I checked in 'Brave' browser and the top URL updates correctly. If required you can have a look how they do it:
https://github.com/brave/brave-core
They are using Chromium, but they use their own adaptation of it.
Maybe try a smaller, open source browser that is a bit smaller. There are a few lightweight browsers that use the Chromium library; perhaps the answer lies within those code bases.
@JamesSmartCell we wrapped the History API and installed a hook to do this on iOS. See if it helps: https://github.com/AlphaWallet/alpha-wallet-ios/pull/3093/files
@ChintanRathod well worth trying this method: you can easily test if it will work before committing any code by working the autographnft.io page with a few updates, then page the AW app out with a breakpoint at the getSerialisedBundle method. By looking through what is dumped here you'll know if the page changes are recorded.
I tried a 'macro level' version of this just by clicking on a few items then testing navigation but it doesn't record the page changes; so that was inconclusive; it may still record the history updates.
@SavalakhDev - here is your first task. Feel free to ask questions here if you need more information.
Submit a PR for this issue once you are done, then we will take it forward with other tasks.
Hey @SavalakhDev - did you get a chance to look at this issue?