Open jakob-stoeck opened 10 years ago
Thanks a lot for the report.
Are you certain chrome.storage
isn't similarly affected by that setting?
After further inspecting, the error does not always show up but just if some scripts are included e.g. this one:
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
which is used on websites to Optimize Social Plugin Performance
It seems that this script creates an iframe which then proxy.js chokes on when used with disconnect. proxy.js is parsed twice, once by the original page w/o error and twice b/c of the iframe which then throws the error. I’ll edit the to replicate part above.
Right now I just try/catch’ed it. Not sure whether disconnect is negatively impacted by this, though.
try {options = SAFARI ? safari.extension.settings : localStorage; } catch(e) {}
Ah, I haven't had a chance to test yet, but I suspect the error is only generated from content/injected scripts. If so, the try ... catch
is a reasonable workaround since the (library) user shouldn't be setting options there (although better would be figuring out how to not run the code at all in content/injected scripts).
Bump. The plugin for Chrome/Chromium still suffers from this issue. Any chance to get the try/catch fix in?
@nmschulte I don’t think this project is maintained any longer, but I maintain a fork that’s used in production. The access error was patched there a while back.
The Disconnect plugin/extension (v5.18.23, by disconnect.me, from the store) I use w/ Chromium is using a version of port.js that still suffers from this issue. That's all I was trying to get fixed; perhaps I should poke disconnect.me some other way.
@nmschulte Oh, I’m not sure what’s up with the browser extensions (or why I’m still assigned to this issue) – I stopped working on Disconnect a couple years ago.
3 years later and I still get this problem. I hope that pull request fixes it.
Another 1.5 years passed and this is still not fixed and PR that should fix it is open. Is this extension still supported?
Is this options
even used?
Shows as an error in the web console when “Block third-party cookies and site data” option is activated in Chrome:
This line is the culprit:
options = SAFARI ? safari.extension.settings : localStorage;
Access to
localStorage
is not given for extensions when above-stated option is activated.I’m not sure how this line is used, though and if try/catch-ing it helps or e.g. switching to the chrome storage API. Any thoughts?
To replicate:
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>