Possible to disable browser navigation/refresh?

Is there any way to prohibit a user from refreshing her browser or going back/forward in browser while on a specific page (in a specific state) in a Bubble-built application? Thanks.

1 Like

I don’t think so (have you seen sites that do this)? That sounds very spammy, don’t think a browser would let anyone do this.

Well, now that you mention it, it does seem rather spammy. I’ll have to rethink my data flow a bit. My challenge is that users will be inputting a “short creative writing” work into a multi-line input based on a prompt that I give them. My goals are to 1) prevent them from losing their work by accidental back/forward/refresh, and 2) prevent them from getting a new prompt because they didn’t like the first one.

I think number two is easy enough by saving the prompt to the (new) user’s record upon opening the pop-up state. Was more worried about number one. May try implementing some sort of auto-save mechanism for that (though I’m a little concerned about the impact on number of workflow runs that would rack up).

yeah, i would this that way as well, but that will indeed to quite some workflows on the server, as each keystroke basically will trigger a workflow.

There is already a standard way to show warning when trying to exit a browser page. Microsoft had introduced that and then other browsers implemented it too. Probably it is supported on mobile browsers too (haven’t tried)

If you have Firefox and don’t mind installing the Silverlight plugin try pressing “Studio” at http://clipflair.net (it will provide Silverlight installation button if the plugin is missing or browser will ask you if you want to activate the Silverlight plugin for that site if it is already installed), then you can see how I use it when you press Back

various online tools use that to prevent you from losing work when going back (esp. those that don’t have an autosave, or where saving takes sometime / isn’t designed to be done incrementally and you have a big document)

in ClipFlair Studio you’re supposed to save to disk your activity, you’re not editing some online instance of it, so I definitely needed to warn the user when browser page is closing


Note: To combat unwanted pop-ups, browsers may not display prompts created in beforeunload event handlers unless the page has been interacted with. Firefox has implemented this policy since Firefox 44

1 Like

To limit the number of workflows, try a “Do every X seconds” with the condition that the text X seconds ago is different than now. @emmanuel can confirm if this will help alleviate excessive workflow runs while having auto-save functionality.

Actually no, since the conditions needs to be checked on the server. Any data operation workflow is run on the server as well.

isn’t there any data caching on the client? I had to add such a timer in a specific situation and it doesn’t seem to slow the app although I poll an object continuously, but I added a condition to make sure I don’t write to the data if it is the same as my UI item

that UI item isn’t manipulated by the user, but automatically via dynamic initial value, which doesn’t seem to throw value changed event, that’s why I had to do this polling

is reading a data value repeatedly also tasking the server? or is the value cached locally and some webhook (or similar method) set up to update the cache at the client if data changes on the server? (the cache would be also updated if data changed at the client side of course, together with writing it to the server)

Thanks for the ideas/discussion. In my specific case, I could get away with auto-saving every thirty seconds or so and wouldn’t mind the workflow count. But I guess not sure what happens in UI itself if timed workflow triggers as user is typing. It would be bad if it caused delayed or missed keystrokes.

I think there are hundreds of sites that do this preventing user to press back button. This happens a lot in e-commerce sites since pressing a back button will trigger a logic built on previous page, such as submitting a payment to payment gateway.

Many business apps do this too, sometimes they hide all the browser buttons. All of these are done using javascript.

Are they not allowed to do this anymore?

I am visiting this thread because I am wondering how we go about it using bubble. There’s definitely a need to do this actually.