Daddoon / BlazorMobile

Create full C# driven hybrid-apps for iOS, Android, UWP & Desktop with Blazor!
MIT License
413 stars 55 forks source link

window.history.go / back fire OnNavigating handler on Android #168

Open Daddoon opened 4 years ago

Daddoon commented 4 years ago

window.history.go / back, fire OnNavigating handler on Android .

This is related on how Webextension works with the onbeforerequestevent.

Daddoon commented 4 years ago

Same issue here related : https://github.com/piroor/newtabfromlocationbar/issues/18#issuecomment-347074234

Daddoon commented 4 years ago

Some documentation : https://stackoverflow.com/questions/45139926/how-to-check-if-a-tab-has-been-reloaded-in-background-js

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts

As we can’t enforce some behavior between the webnavigation api and webrequest api, one solution is to inject a content_script that wrap the window.history API, and notify the background worker that the next request is coming from the history from JavaScript, and that the request can be executed without check.