Basically i'm trying to remove few localstorage keys from my page.
The script I'm using is:
box.emptyStorageFilter = (function() {
$('header nav li a').off().on('click', function(e) {
localStorage.removeItem('list_customers');
localStorage.removeItem('list_orders');
localStorage.removeItem('list_products');
localStorage.removeItem('filter_category');
});
}());
I have no idea what's wrong, since it's working on EVERY browser (including IE 8,9,10) but IE 11!
At the console I get this Error:
SCRIPT5: Access is denied.
local storage does not work in local mode it's a security thing (but it can be made 2) http://social.technet.microsoft.com/Forums/ie/en-US/61177c2b-6a38-4207-9cbe-ccd6c86b1d42/html5-local-storage-broken-in-ie11-win-81-x64-error-function-expected#f345c94d-f404-4b4b-b808-d8849646be27 please post an update if you find anything...
Related
I'm using localStorage in my JS application and I was wondering why IE9 claims localStorage == undefined. As far as I know, IE8 supports it, is here any way to get it working in the new version?
Are you testing this on a local HTML file? i.e. a file:/// URL?
localStorage is only available on HTTP websites. That hasn't changed in IE9 Dev Preview.
IE 11 WORKS
All you need two do add file://127.0.0.1 to the trusted zones under the security
tab (NOTE: make sure https check box IS not checked)
add this line to the top or your script, depending on your code you may not need to unless you get could not connect to the internet.
!localStorage && (l = location, p = l.pathname.replace(/(^..)(:)/, "$1$$"), (l.href = l.protocol + "//127.0.0.1" + p));
if (typeof(Storage) != "undefined") {
// Store
localStorage.setItem("lastname", "Smith");
// Retrieve
alert(localStorage.getItem("lastname"));
} else {
alert("Sorry, your browser does not support Web Storage...");
}
Try to open the file like this
file://127.0.0.1/c$/pathtofile/file.html
I am currently trying to make an extension that will auto unsuspend tabs that used to be suspended with the great suspender.
function unsuspend() {
if(document.location.href.startsWith("chrome-extension") &&
document.location.href.indexOf("/suspended.html#") > -1) {
unsuspendurl = document.location.href.substr(document.location.href.lastIndexOf("&uri=")+5);
return unsuspendurl;
}
}
The problem is that when an extension is uninstalled you get an error page that is the document (chrome-error://chromewebdata/).
I have tried to find if anyone has a way to get the omnibox text but no luck.
I think extensions can't access other extensions pages. So I had to do this semi-automatically in my attempt to solve this :) https://gist.github.com/JLarky/0385d22305c86ed5ca05b254a1e902ac
One of our client is getting ""SCRIPT5: Access is denied" error when accessing web sites on Windows 8.1/IE11. Only one client is having this issue not all.
when we looked at the error message it turns ut it failed when tried to access
_global.localStorage
Client said its working fine if they add our site in "Trusted Site".
the problem we having is that none of our dev/test environments has this issue.we are running same version of OS and IE as client. so we are having bit difficulty trying to reproduce this issue.
sa mentioned here
Access Denied for localstorage in IE10
i have tried turn on/off DOMStorage/Enhance Protection Mode/Protection Mode but still no luck.
our best guess so far is there must be some setting/group policy which applied by Client's IT dept which causes this issue rather code issue as it works for all other clients.
so my question here is
which setting/group policy/domain setting i can check so that i can reproduce this error.
How can i fix the issue w/o making any code change as client has more than 1000 users so only changing the policy by IT dept is the only option here rather asking every user to add to "Trusted Site"
is there anything that i missed to check.
any help would be awesome.
I had the same issue and solved it in the next way:
let storage;
try {
storage = localStorage; // throws error if not supported by browser
} catch(e) { // caching this error and assigning fallback
let innerStorage = {};
storage = {
getItem: function(e) {
return innerStorage[e]
},
setItem: function(e, i) {
return innerStorage[e] = i
},
removeItem: function(e) {
delete innerStorage[e]
}
}
Best regards,
Aleh
I use this code to detect changes to a form and then perform a get request using the serialized form data. This works in all browsers that I have tested on. But I'm on a mac and now I get emails from people saying that it doesn't work in IE 11. What could be wrong?
Error message: "webpage.com is not responding due to a long running script"
I've tried testing this myself using IE 11 in a VirtualBox but the webpage becomes unresponsive as soon as I change something to the form. I'm not sure how to find out what's wrong.. I have no loops so I don't get why this script would make the page unresponsive.
Please help.
jQuery('.appselect').change(function(e) {
if (jQuery(window).width() > 800) {
jQuery.get('/?' + jQuery('#appfilter').serialize(), function(data) {
jQuery('#postloop').replaceWith( jQuery(data).find('#postloop') );
if (!jQuery('#pagination').length) {
jQuery('#postloop').after(jQuery(data).find('#pagination'));
} else {
jQuery('#pagination').replaceWith(jQuery(data).find('#pagination'));
}
});
}
});
This is a wordpress page, but I think the problem is not related to Wordpress. I'm using jQuery 1.11.1.
Try with:
var html = jQuery(data).find('#postloop').html();
jQuery('#postloop').html(html);
I am using a JavaScript error logging tool to log any JavaScript errors on my mobile site and I am seeing a large number (22,000 in under a month) of this error:
Uncaught TypeError: Cannot read property '_pmh' of null
I can see from the addthis_widget.js code that it is originating from that script.
I can also tell that it only affects mobile Android and Google Chrome browsers, these in particular:
Android 4, Android 4.1, Android 4.2, Chrome 11, Chrome 18, Chrome 25, Chrome 26, Chrome 27, Chrome Mobile 18, Chrome Mobile 25, Chrome Mobile 26
I am using the following external JavaScript include:
http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4b6adff375a64db9
and have the following configuration object set:
<script type="text/javascript">
var addthis_config = {
data_ga_property: 'UA-18721873-1', // real GA profile hidden for privacy purposes
data_ga_social: true
};
</script>
Is there anything I can do to prevent this error from occuring so many times on these browsers?
I have located the cause of this issue and it is down the following code.
if (window.addthis) {
window.addthis = null;
window._adr = null;
window._atc = null;
window._atd = null;
window._ate = null;
window._atr = null;
window._atw = null;
}
This was an attempt to cleanup the objects lying around when moving between pages dynamically to prevent memory issues.
addThis now provide support for this problem, their support department sent me the following link:
http://www.addthis.com/blog/2013/05/07/a-brief-history-of-using-addthis-dynamically/#.Uklx4RCKyas
and the following explanation/information:
Along with other information from my peers and such, I've come up with
the proper code which should be executed when moving from virtual page
to virtual page such as in your mobile application. Rather than
nulling any of the AddThis related objects, they must be left alone.
When the page URL or Title (or any other AddThis configuration option)
that you want to be used by our buttons changes, you should execute
our method:
addthis.update(type, key, value)
It takes the three parameters: type, key, value.
Type is either "share" or "config". The key is the same key you would
set according to our API documentation. What you likely need to know
are just the two keys: "url" and "title". The value is of course the
value you want those options to have.
After you have updated all of the options you need to update using
that method, you need to invoke this method:
addthis.toolbox(cssSelector)
The cssSelector is usually going to be ".addthis_toolbox" but if for
some reason you don't want to refresh all of your toolboxes, you can
be more specific about it.
Once you have made those changes to your code, I believe that our
tools will work properly for you and that there will be no more "null
object" related javascript errors.
You can look at this JSFiddle to see an example of dynamically
changing content: http://jsfiddle.net/j5addthis/r6Utv/
I'm having the same issue, but it appears that there was, at one point, a fix to your specific case above by simply upgrading the script that you're using from addthis to version 3.0 by changing this:
http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4b6adff375a64db9
To this:
http://s7.addthis.com/js/300/addthis_widget.js#username=xa-4b6adff375a64db9
Read more here: http://support.addthis.com/customer/portal/questions/1021465-addthis-widget-js-throwing-cannot-read-property-pmh-of-null-error-on-android-and-chrome
Note though, as I mentioned above, my issue continues to persist even with version 3.0 despite the AddThis help desk stating that should work.