Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
localstorage-browser-polyfill
Advanced tools
[![NPM version](https://img.shields.io/npm/v/localstorage-browser-polyfill.svg?style=flat)](https://npmjs.org/package/localstorage-browser-polyfill)
IE6/7 localStorage
test
IE 8 and 9 store data based only on hostname, ignoring the scheme (http vs https) and port number as required by the specification.
Do not use
localStorage.some = 'abc'
andlocalStorage.some
change storage, You must uselocalStorage.setItem('some')
andlocalStorage.getItem('some')
.
require('localstorage-browser-polyfill')
<script src="http://unpkg.com/localstorage-browser-polyfill/localstorage-browser-polyfill.js"></script>
Current browser support for localStorage?
if (typeof window.localStorageBrowserPolyfill === 'undefined') {
console.log('Support!')
}
else {
console.log('Not support!')
}
Because can't perfect simulation storage event, so use regularly polling.
if (typeof window.localStorageBrowserPolyfill === 'undefined') {
// IE onstorage
if (document.attachEvent) {
document.attachEvent("onstorage", function () {
})
}
else{
window.addEventListener("storage", function () {
})
}
}
else {
setTimeout(function () {
var some = localStorage.getItem('some')
// Do something
setTimeout(arguments.callee, 500)
}, 500)
}
Partial workaround: regularly probe the storage's value and compare with the last known value on all pages where you want to listen to this event, and track the last submitted value to determine if the modification was triggered locally. 5. In iOS 5 & 6 localStorage data is stored in a location that may occasionally be cleared out by the OS. 6. In private browsing mode, Safari, iOS Safari and the Android browser (not include Chrome for Android) do not support setting sessionStorage or localStorage. 7. IE 8 and 9 store data based only on hostname, ignoring the scheme (http vs https) and port number as required by the specification. 8. Storing large amounts of data in Safari (on OSX & iOS) can result in freezing the browser see bug
FAQs
[![NPM version](https://img.shields.io/npm/v/localstorage-browser-polyfill.svg?style=flat)](https://npmjs.org/package/localstorage-browser-polyfill)
The npm package localstorage-browser-polyfill receives a total of 26 weekly downloads. As such, localstorage-browser-polyfill popularity was classified as not popular.
We found that localstorage-browser-polyfill demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.