I have a Google Chrome extension which needs to reload a page in a specific situation. The most common solutions, such as location.reload()
did not work as the page shows the prompt "Changes you made may not be saved.".
Please note the page in question is not mine, so I do not have full access to modify it at my will. I am using a Google Chrome extension.
I tried the following approaches:
- Simulate an "Enter" press when the prompt is shown. The prompt does not identify the event.
- Modify the function
beforeunload
. It seems this function is no longer exposed in recent browser versions..
Is there any way to reload the page and ignore the prompt message, either from an injected JavaScript or Google Chrome Extension function?