In a mobile SPA app, I have overridden the default back behavior to switch between pages.
// create history states
history.pushState(-1, null); // back state
history.pushState(0, null); // main state
history.pushState(1, null); // forward state
history.go(-1); // start in main state
window.addEventListener('popstate', function (event) {
var state = event.state;
if (state === -1) {
if (!this.goBack()) {
return false;
}
// reset state to what it should be
history.go(-state);
}
}, false);
Which works great for all mobile devices, except when there is a hardware back button on certain Android Devices (Samsung S5, BlackBerry Key 2 are two that I am testing that it happens to). The popstate event is never called when the hardware back button is pressed, so the user gets dumped out of the application rather than going back a page. Is there any known way of intercepting this hardware back button through Javascript?
To be clear, back is working perfectly for allmost all devices, except those which have a hardware back button (not a softbutton or swipe back like in Android 10) which doesn't seem to trigger the history popstate event.
from Android Hardware Back Button not triggering 'popstate'
Your File is Very Usefull File... 100% working... Thanks For Uploading.... Please More File Uploading and free password...
ReplyDeletePlease Visit Our Website,Mobile Flash tool,,FastBoot Frp Remover Tool,Country Unlock Tools,iPhone Unlock tools,PC Software Download,
Usb Flash Tool Mtk,Spd,Qualcoumm,Samsung, ADB Tool Free Download,Iphone Unlock Tool Download,
All Flash Box Driver Download, Android BackUp Software Tool, Mobile flashing Tools , Android Data Recovery Tools,Cracked Box,EMMC Rom Read And Write Tool Download,Huawei Frp Tool Download,Iphone Icloud Download,
LG Root Tools Download,LG FRP Unlock TOOL,Motorola Frp Unlocker, Nokia unlock tool Download, Oppo Unlock Tools Download,Qualcomm IMEI Repiar tools,
Qualcoum cpu frp tools Download,Android Root Software Download,Samsung FRP Tools Download,Box Setup File Download,
Spd Imei Repair Tools, Xiaomi Unlocker Tools ,Xiaomi Usb Drive Download, Etc File Tool Free Download BY www.Androidgsm.com
<a