Open Dimitar5555 opened 3 months ago
Hmm, my fields are cleared even when the script (and Tampermoney) is disabled.
However, this only happens in Firefox; in Google Chrome, the fields are saved even when the extension is enabled
Okay, I restarted the browser in safe mode and the fields started saving.
After that I restarted the browser again, enabled Tampermonkey and the fields are also saved. However, after running the script, the fields were cleared
However, after disabling the script, the fields continue to be cleared
This happens when Tampermonkey even embeds a script like this:
// ==UserScript==
// @name Better osm.org
// @match https://www.openstreetmap.org/*
// ==/UserScript==
function main() {}
init.then(main);
After enabling/disabling the script or TamperMonkey, you have to open a new tab with osm. Otherwise it seems to "remember" what was enabled.
@Dimitar5555 if you refresh the page do you lose the contents of the fields? (with Tampermonkey disabled)
@Dimitar5555 if you refresh the page do you lose the contents of the fields? (with Tampermonkey disabled)
The content remains, but if the osm tab was open while TamperMonkey was enabled, you need to close the tab and open a new one, after disabling TamperMonkey. If you don't do it, the content is always lost.
Total (in each case I restarted the browser):
Firefox (128):
Everything works with the extension disabled
Google Chrome (125) regardless of Tampermonkey:
I'll report the Firefox bug to the developer Tampermonkey, but something tells me there's some kind of problem on the osm.org side too
upd: https://github.com/Tampermonkey/tampermonkey/issues/2092
I'm using Firefox 126.0.1 with Linux Mnt 21.03 which may make a diffrence.
I found a workaround: in 0.4, I no longer run the extension on important pages with forms:
https://www.openstreetmap.org/diary/new https://www.openstreetmap.org/message/new/ https://www.openstreetmap.org/reports/new/
For note and comment form pages, the problem persists because the extension changes these pages
Looking at the code, it shouldn't do anything with the message text boxes but for some reason it clears them when you change the page and go back. If the script is disabled (but TamperMonkey is enabled) the issue is not present.
https://github.com/deevroman/better-osm-org/assets/19364673/e3ca2e63-f22b-460b-832d-0fe5ec150b33