Where can I find the localstorage folder for Microsoft Edge? I am seeking the folder path.
问题:
回答1:
I test this issue and try to find the location for local storage file on computer for Edge.
Based on my search this file is hidden and if you turn the option on to display the hidden files then also this file will not get visible.
To see this file you need to use the search option to find the file in windows Explorer.
If I copy the path from address bar then it shows path below.
ms:displayname=Search%20Results%20in%20Default&crumb=System.Generic.String%3Alocalhost&crumb=location:C%3A%5CUsers%5Cpanchals%5CAppData%5CLocal%5CPackages%5CMicrosoft.MicrosoftEdge_8wekyb3d8bbwe%5CAC%5C#!001%5CMicrosoftEdge%5CUser%5CDefault
If I check the file properties then it shows the path below.
C:\Users\panchals\AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC#!001\MicrosoftEdge\User\Default\DOMStore\IS3DHS80
User can move until 'Default' folder using user interface and then need to use search option to locate the file.
File name will be localhost[1]
To Make a test, User can refer code below.
<!DOCTYPE html>
<html>
<head>
<title>Simple Drawing App</title>
<meta http-equiv="X-UA-Compatible" content="IE=10">
<style>
html {
-ms-touch-action: none;
text-align: center; /* Center all contents of the page. */
}
</style>
</head>
<body id="bodyElement">
<!-- This ID is used in the following script block for feature detection. -->
<h1>Simple Drawing App</h1>
<h3>Example 2</h3>
<canvas id="drawSurface" width="500" height="500" style="border:1px solid black;"></canvas> <!-- The canvas element can only be manipulated via JavaScript -->
<div>
<button id="erase">Erase</button>
<button id="save">Save</button>
<button id="load">Load</button>
</div>
<script>
function requiredFeaturesAvailable() {
return (
!!window.addEventListener && // Use the double negative "!!" to force the object to a Boolean value.
!!document.createElement('canvas').getContext &&
!!window.localStorage
);
} // requiredFeaturesAvailable
if (!requiredFeaturesAvailable()) {
document.getElementById('bodyElement').innerHTML = "<h2>Required features are not supported by this browser.</h2><p>To use this application, upgrade your browser to the latest version.</p>";
}
else {
window.addEventListener('load', init, false); // Safety first.
function init() {
var canvas = document.getElementById('drawSurface'); // A static variable, due to the fact that one or more local functions access it.
var context = canvas.getContext('2d'); // A static variable, due to the fact that one or more local functions access it.
context.fillStyle = "purple";
if (window.navigator.msPointerEnabled) {
canvas.addEventListener('MSPointerMove', paintCanvas, false);
}
else {
canvas.addEventListener('mousemove', paintCanvas, false);
}
document.getElementById('erase').addEventListener('click', eraseCanvas, false);
document.getElementById('save').addEventListener('click', saveCanvas, false);
document.getElementById('load').addEventListener('click', loadCanvas, false);
function paintCanvas(event) { // The "event" object contains the position of the pointer/mouse.
context.fillRect(event.offsetX, event.offsetY, 4, 4); // Draw a 4x4 rectangle at the given coordinates (relative to the canvas box). As of this writing, not all browsers support offsetX and offsetY.
} // paintCanvas
function saveCanvas() {
window.localStorage.canvasImage = canvas.toDataURL(); // Save the user's drawing to persistent local storage.
} // saveCanvas
function eraseCanvas() {
context.clearRect(0, 0, context.canvas.width, context.canvas.height);
} // eraseCanvas
function loadCanvas() {
var img = new Image(); // The canvas drawImage() method expects an image object.
img.src = window.localStorage.canvasImage; // Retrieve the last saved artistic achievement from persistent local storage.
img.onload = function () { // Only render the saved drawing when the image object has fully loaded the drawing into memory.
context.drawImage(img, 0, 0); // Draw the image starting at canvas coordinate (0, 0) - the upper left-hand corner of the canvas.
} // onload
} // loadCanvas
} // init
} // else
</script>
</body>
</html>
User can see the image data in file.
Also to cross check, User can enter the data in local storage from developer tools and try to find that data in file.
Output: