Поиск в Поддержке

Избегайте мошенников, выдающих себя за службу поддержки. Мы никогда не попросим вас позвонить, отправить текстовое сообщение или поделиться личной информацией. Сообщайте о подозрительной активности, используя функцию «Пожаловаться».

Learn More

Local Storage is not stored value.

  • 26 ответов
  • 1 имеет эту проблему
  • 13 просмотров
  • Последний ответ от vipmaster-05

more options

firefox 67.0.3 (android) firefox 68.0b14 (android) (opera 52.4.2517.140781 (android))

Local Storage is not stored value. Wrote a simple example. It shows the current value of 'LS'. Went clicked in the monitor. The value of 'LS' has changed . Closed the browser - opened and the value 'LS' is not preserved.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="robots" content="index, follow"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="copyright" content=""> <meta name="keywords" content=""> <meta name="description" content="localstprage"> <title>localstoragetest</title> <style> *{margin: 0px; padding: 0px;} #iphone, #android{font-size: 28px;} #del{width: 50px; height: 50px; float: right; background-color: green;} </style> <script> window.addEventListener('click', function(e) // срабатывает при загрузке страницы БЕЗ CSS { "use strict"; var id = e.target.id; var iphone = document.getElementById("iphone"); var cur_LS = localStorage.getItem("test"); if (cur_LS === "123") {localStorage.setItem("test","ABC");} if (cur_LS === "ABC") {localStorage.setItem("test","123");} if (cur_LS === null) {localStorage.setItem("test","ABC");} if (id === "del") {localStorage.removeItem("test");} cur_LS = localStorage.getItem("test"); iphone.textContent = "set_new = "+cur_LS; }); window.addEventListener('DOMContentLoaded', function() // срабатывает при загрузке страницы БЕЗ CSS { "use strict"; var android = document.getElementById("android"); var cur_LS = localStorage.getItem("test"); android.textContent = "read "+cur_LS; }); </script>

read
new
DEL_LS

firefox 67.0.3 (android) firefox 68.0b14 (android) (opera 52.4.2517.140781 (android)) Local Storage is not stored value. Wrote a simple example. It shows the current value of 'LS'. Went clicked in the monitor. The value of 'LS' has changed . Closed the browser - opened and the value 'LS' is not preserved. <!DOCTYPE html> <html lang="ru"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="robots" content="index, follow"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="copyright" content=""> <meta name="keywords" content=""/> <meta name="description" content="localstprage"/> <title>localstoragetest</title> <style> *{margin: 0px; padding: 0px;} #iphone, #android{font-size: 28px;} #del{width: 50px; height: 50px; float: right; background-color: green;} </style> <script> window.addEventListener('click', function(e) // срабатывает при загрузке страницы БЕЗ CSS { "use strict"; var id = e.target.id; var iphone = document.getElementById("iphone"); var cur_LS = localStorage.getItem("test"); if (cur_LS === "123") {localStorage.setItem("test","ABC");} if (cur_LS === "ABC") {localStorage.setItem("test","123");} if (cur_LS === null) {localStorage.setItem("test","ABC");} if (id === "del") {localStorage.removeItem("test");} cur_LS = localStorage.getItem("test"); iphone.textContent = "set_new = "+cur_LS; }); window.addEventListener('DOMContentLoaded', function() // срабатывает при загрузке страницы БЕЗ CSS { "use strict"; var android = document.getElementById("android"); var cur_LS = localStorage.getItem("test"); android.textContent = "read "+cur_LS; }); </script> </head> <body> <div><span id="android">read</span></div> <div><span id="iphone">new</span></div> <div id="del">DEL_LS</div> </body> </html>

Все ответы (20)

more options

Can you provide a working example of the issue on https://jsfiddle.net/ or https://codepen.io/ ?

more options

yeah, sure. here you go. link text (I'm running my tests on Denver.)

more options

vipmaster-05 said

yeah, sure. here you go. link text (I'm running my tests on Denver.)

on, 'codepen' too, not works now tried. if you need video error record.

more options

I can't really reproduce the issue. It's always "read ABC" after opening the browser.

more options

TyDraniu said

I can't really reproduce the issue. It's always "read ABC" after opening the browser.

not exactly. please try this way - open the browser the first line is the current value. press to monitor the second line changes to display the new value. ((ideally, when the first line and the second line are different) remember in mind the value of the second line. close the browser. open the browser and see that the first line had new meaning. I have old.

more options

Hi vipmaster-05, how are you closing your Firefox for Android:

close the browser.

(I use the Restore Tabs setting, so I don't think I can test this problem.)

more options

jscher2000 said

Hi vipmaster-05, how are you closing your Firefox for Android:
close the browser.

(I use the Restore Tabs setting, so I don't think I can test this problem.)

good idea. I close my so - click the square button (the button at the bottom right of the phone monitor) then click on the basket (on the bottom centre of the monitor). this should free up memory.

more options

can I make a video for You?

more options

Maybe a video would be good.

It sounds as though you are using the Android system-level feature -- recent applications? -- to unload Firefox, and not the built-in Quit command (the Quit command is linked with clearing at least one kind of data).

more options

made when opening seen in the first row of null - values no. press fit into in the store "ABC" then read from it and eventually see the second line ABC. reopen the browser in the first line reads the value from the store and it is not ABC.

https://fex.net/s/otb6lyl (there are 2 identical files. it just happened. if you need video can do any more and send you like.)

more options

tell me please, did You manage to reproduce the problem? video downloaded?

more options

Thank you for the video, I understand what you are seeing. I am not losing the saved value, but as I mentioned, my Firefox for Android is set to restore tabs, which could affect how data is retained.

more options

jscher2000 said

Thank you for the video, I understand what you are seeing. I am not losing the saved value, but as I mentioned, my Firefox for Android is set to restore tabs, which could affect how data is retained.

that is, the solution to this problem, I can't wait(?

more options

You could try it and see whether it makes any difference on your device:

menu button > Settings > Advanced > Restore tabs > Always restore

more options

I'm developing. I can use any browser from 15. but the customers I will not explain how and what to use. technology must work flawlessly and equally.

this problem is only in two browsers and appeared recently after some update.

where else can I write to resolve this issue?

more options

jscher2000 said

You could try it and see whether it makes any difference on your device: menu button > Settings > Advanced > Restore tabs > Always restore

I Supplement my message above. looked now. I have, too, is the restoration of tabs.

more options

There must be some other difference between your Firefox for Android and the two volunteers testing in this thread. I can't think of what would cause it.

Is the problem only with your app or does it affect other pages that use local storage? Example: https://mdn.github.io/dom-examples/web-storage/

more options

jscher2000 said

There must be some other difference between your Firefox for Android and the two volunteers testing in this thread. I can't think of what would cause it. Is the problem only with your app or does it affect other pages that use local storage? Example: https://mdn.github.io/dom-examples/web-storage/

Thanks. a good example for tests. But it doesn't work either. There is a Fox - choose a turtle - rediscovering and there again, Fox. I can make a video, too. (I specifically checked this example on the PC, everything is correct.)

previously, I worked fine (both in Opera and FireFox), I wrote a lot of JavaScript and tested everything.

more options

Is the local storage value only lost when you swipe off the app? In other words, is it preserved if you close that page and open it in a different tab without swiping off Firefox?

more options

jscher2000 said

Is the local storage value only lost when you swipe off the app? In other words, is it preserved if you close that page and open it in a different tab without swiping off Firefox?

Yes, there is a pattern. 1) if you close the tab but do not close the browser. That values are always saved. 2) if you do not close the tab and close the browser, the values are not saved. (I will tell you, in opere exactly such laws).

  1. 1
  2. 2