While the Android feedback button cannot be directly connected to the context of a progressive web application, there is an api history that we can use to achieve the desired result.
, , , "" .
, , :
window.addEventListener('load', function() {
window.history.pushState({}, '')
})
mdn:
pushState() : , ( ) () URL [...], , URL- .
"". , .
popstate , , ( history.pushState).
popstate , .
, :
window.addEventListener('load', function() {
window.history.pushState({}, '')
})
window.addEventListener('popstate', function() {
window.history.pushState({}, '')
})
, , , "", , !
, . , api, url , .
. popstate :
history.pushState(), [...] popstate .
, popstate , , back-button-closes-app , , , :
window.addEventListener('load', function() {
window.history.pushState({ noBackExitsApp: true }, '')
})
window.addEventListener('popstate', function(event) {
if (event.state && event.state.noBackExitsApp) {
window.history.pushState({ noBackExitsApp: true }, '')
}
})
, "" -, , .