Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, this is a great little module - anything that will make someone switching from a regular 'word processing' background feel more at ease is great. Of course, a web browser is not the same as a word processor...
Knowing nothing about how browsers work, I was wondering - is it possible to monitor clicking on the browser 'Back' or 'Forward' button as well? This module gives a warning when you click on a link - but a lot of times people simply navigate away using the 'Back' button. Thanks for this great module!
Comment | File | Size | Author |
---|---|---|---|
#4 | node-edit-protection.zip | 469 bytes | ircdirk |
Comments
Comment #1
febbraro CreditAttribution: febbraro commentedI am listening to the window unload event. It gets fired when using the back button, but it appears to get called too late in the process to actually prevent the back action from happening. So, it seems they get a warning, but it does not stop them. I'll have to investigate a bit further, but the back button is obviously a big one and difficult one to get around.
Comment #2
ramper CreditAttribution: ramper commentedI see, thanks. This is a useful module for those moving from a regular word processing background.
Comment #3
deverman CreditAttribution: deverman commentedAny progress on this module we have users losing their work regularly.
Comment #4
ircdirk CreditAttribution: ircdirk commentedYes its possible i made my own version of node-edit-protection.js It does work for back buttons and jquery using window.onbeforeunload. Please check it out. Its simple and it works ;)
Comment #5
throk CreditAttribution: throk commentedI tested ircdirk's code and it does in fact work. BUT, it does not work at all in Internet Explorer 8 (I haven't tested other versions). It works fine in Firefox and Chrome.
It would be nice if both versions could be combined so that they work in both browsers. I'm not very good at Javascript so I'm not really the guy to dive into this.
I'm re-posting ircdirk's code here so that it can be seen w/o downloading and unzipping it.
Comment #6
mcrittenden CreditAttribution: mcrittenden commentedSub.
Comment #7
febbraro CreditAttribution: febbraro commentedIf someone could provide a patch that addresses some of these issues I would gladly apply/commit/release it.
Comment #8
geerlingguy CreditAttribution: geerlingguy commentedSubscribe.
Comment #9
Mohammed J. RazemClosing this as outdated as this version will no longer be supported/maintained.