New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
localStorage does not work in some configurations of IE #1291
Conversation
Hey @mizzao, thanks for the report. Yeah, it looks like IE localstorage security is kinda a mess. I think it's possible all our testing environments (VMs, browserstack) have it running as a privileged user =( Looking at the code, I don't see much difference between devel and 0.6.4. Can you check to see if you see the same error in the released meteor, so we know if this is a regression on devel? I will try to replicate this in my VM. |
I could not replicate this in my IE10/Win7 VM. I tried both a stock parties example and crowdmapper.meteor.com. In both cases I was able to login, close the browser and restart it, and see I was logged in as the same user as before. I made a non-admin user and checked the Internet Options had protected mode enabled. Maybe this is Win8 only? I'll see about getting a Win8 VM. |
Tested on IE10/Win8 on Browserstack. It worked fine, but protected mode was not enabled, and I couldn't enable it (requires system administrator) |
Hi @n1mmy, I see this error with the default Meteor project on 0.6.4.1 as well, although I had to include the Parties on 0.6.4.1 crashes similarly: Creating an account or logging in is impossible:
This is clearly a Win8/IE10 problem when protected mode is enabled by default due to system or network administrator settings. |
I think this might allways been an issue, we have to test the actual storage - think this applies to ff etc. The localstorage is there but we are not allowed to use it. I've made a solution but didn't make it a pr. since theres allready another working on it - so i've put it as inspiration. have a look at: comment issue 1221 |
link to code (github didn't make the link correct the first time) https://github.com/raix/meteor/blob/devel-localstorage-remove-jquery/packages/localstorage/localstorage.js |
You got rid of the As an aside, I'd really like it if we had the option to start the Meteor client with local storage turned off. Sometimes it's nice to be able to log in as different users from different tabs, for various reasons including testing. |
for now would this work for your test usage?: window.addEventListener('storage', function(e) {
if (e.key === 'Meteor.loginToken' && e.newValue !== '') {
localStorage.setItem(e.key, '');
localStorage.setItem('Meteor.userId', '');
}
}, false); |
@raix isn't that going to log out the existing user as well? I think some code for allowing multiple logins would need to just force Meteor to use the shimmed storage instead of local storage. I would probably just do monkey patching... |
@mizzao true, I'm thinking that it could be nice to be able to set options for packages in general. Could be pr. package/global at bundle/runtime. |
@mizzao sounds great! 👍 |
Just to check in: this is still on my plate. I haven't managed to get a Win8 VM with a non-admin user yet. The free VMs from microsoft (https://github.com/xdissent/ievms) don't seem to let me create a second user. I'll see if I can scrounge up a physical machine with Win8, or find a different VM solution. |
@mizzao I tried this on a physical windows 8 machine, and was still unable to reproduce it. I made sure I was logged in as a non-admin user and "enable protected mode" was checked. This is a pretty fresh install, so just about all the settings should be at their default values. Any idea what could be different on my setup that means I don't see the issue. Or ideas on what to change to be able to reproduce it? |
Ok, I made a fresh install of Windows 8 on a machine. Stock install, took windows updates, made a new non-admin user, and confirmed that "enable protected mode" was checked (it was). Everything worked fine, did not see the error. Tested in both desktop and tiled mode (as suggested in one of the threads posted). Any other ideas on how to trigger this? Is it possible microsoft fixed it in an update? Looking at the code, I don't think there has been any relevant change since auth was launched. That is, if the failure is accessing local storage to test if it exists throws, the same error would happen in every release since 0.5.0. Judging from the text in the first link you provided (http://community.spiceworks.com/topic/357825-ie10-script5-access-is-denied), it sounds like this issue affects lots of sites, not just Meteor. Still, there is probably something clever we can do like |
Hi @n1mmy, I was observing this on a corporate laptop that was set up for me already by the IT department. Unfortunately, I returned that laptop at the end of my internship and I don't see this on Windows 7's IE10 on my personal laptop. I'm in China right now where it's very hard to connect to a lot of U.S. sites. Please feel free to leave this issue open or closed as you see fit. If other users have this problem as well, I'm sure we'll see them chime in. |
@mizzao Cool beans. I'll leave this open for now in case someone else has a similar problem and can help narrow it down. Have fun in China =) |
@n1mmy would you take a pr on this, maybe to a test branch for verifying/test the code? (I could do some test to make sure that theres no issues, but only Got an ie 7 or 8 and ie9, otherwise mac) |
Btw. Has to be try catch, if the localstorage is disabled, the localstorage object would still exist and the data would on some browsers just go into the air, so we have to do a "physical" test to make sure the data is stored |
@raix I'm reluctant to do anything on this until we can figure out how to reproduce it. We could do something with try/catch that might fix the problem, but if we don't have a way to test that it actually makes a difference we won't know if we've really fixed the problem or just added unnecessary complexity. |
I'll see if i can reproduce the error - it's not an ie only issue... |
Thanks for the heads up. Looks like you got a clean fix for that already. Is that in Meteor core yet? |
Switch the 'unreachable' url from http://asdf.asdf to http://0.0.0.0
Hi guys, This is still broken in IE11 with certain security policies turned on. See the following: The problem arises right at https://github.com/meteor/meteor/blob/devel/packages/localstorage/localstorage.js#L3. Just trying to grab I have access to a corporate computer that can definitively reproduce this, for the summer, so I'd be happy to help find something that works. I'll be in SF for the week of June 8th through June 14th, planning to drop by June 9th, and would be happy to hack further in person. |
@mizzao agree it should be tested via try/catch - btw. It would be wise to make the local storage api async this imply changes in accounts etc. |
Drop collections after test (WIP)
There were two separate issues here: - npm-shrinkwrap.json wasn't actually being used as part of the watchset/buildinfo, so changes to it might not cause the package to be considered for rebuilding - meteor-npm only compared top-level changes when deciding whether to update, not all changes Fixes meteor#1648
The websocket-driver update includes our PR to relinquish some memory faster. faye/websocket-driver-node#6 The sockjs update mostly consists of aligning the version of faye-websocket it uses internally with the version that we use for our client. It also contains this Vary: Origin change: sockjs/sockjs-node#130
This fixes a circular build-time dependency when building test slices.
@mizzao can you send a PR for this which is tested in your corporate context? |
…ixes meteor#1688. Accessing `window.localStorage` can immediately throw an exception, which needs to be caught. For more information, see http://www.w3.org/TR/webstorage/#dom-localstorage.
I certainly can: #2204. Please ignore the files attached to this issue. I tried using the GitHub issue to PR conversion tool and it created a PR against master. |
…meteor#1688. Accessing `window.localStorage` can immediately throw an exception, which needs to be caught. For more information, see http://www.w3.org/TR/webstorage/#dom-localstorage.
Accessing `window.localStorage` can immediately throw an exception, which needs to be caught. For more information, see http://www.w3.org/TR/webstorage/#dom-localstorage.
Although Meteor._localStorage has historically been used only in browsers, it can be helpful on the server for writing isomorphic code.
Accessing window.localStorage can immediately throw an error in IE (meteor#1291) and other/older webkit versions.
Accessing window.localStorage can immediately throw an error in IE (#1291) and other/older webkit versions.
Hi guys,
I recently started noticing that IE was not working at all on the
devel
branch. I thought it would get fixed, but the problem has persisted for a while. The errors are different on local development and meteor hosting, but both result in a blank page.For example, on http://crowdmapper.meteor.com which is on
0.6.5-rc12
:On local hosting:
It seems like this is caused by the following line of (https://github.com/meteor/meteor/blob/devel/packages/localstorage/localstorage.js : 3) of which kills the rest of the app:
According to this issue the error will go away if running as admin or disabling protected mode.
The machine I'm using has IE10 on Windows 8.
My app indeed worked when I unchecked the following. However, it is unreasonable to expect users to do this and I wonder if there is a way to make Meteor fail more gracefully (such as reverting to the in-memory storage.) Maybe try wrapping the
window.localStorage
call in atry
block?Other references (seems like the default IE security config is just a big fail, sorry):