Description
For our workflow, we need to store links of local folders on some services like erpnext, Plytix, Eniston, kitchen.co etc.
We plan on making master folders for products on Local Network and when we create products in Erpnext, Plytix or create any folders or articles in kitchen.co or eniston we can enter the links to these folders at these places for quick and easy access.
Now chrome and firefox do no natively support opening local folders in windows file explorer by clicking a link. They restrict this for security purpose. Though we can browse the folders and files in a list format in the browser itself, but can't trigger opening a windows file explorer.
For this to work we need the following two chrome extensions
- Local Explorer
- Tampermonkey
Make following settings in Local explorer
- Right click and choose 'Options' - Details of settings but no changes here
- Important step is - Right click on extension icon and choose 'Manage Extension' > Allow Access to File URL should be switched ON
Make following settings in Tampermonkey
- Right click on extension icon and choose 'Manage Extension' > swtich ON 'Allow User Scripts'
- Right click on extension icon and choose 'Options' > Click on '+' button to add new script
- Paste the following script and save
// ==UserScript==// @name LocalStorage → LocalExplorer (final universal version)// @namespace http://tampermonkey.net/// @version 4.3// @description Works on click or when pasted directly in address bar, with or without trailing slash// @include http://*/*// @include https://*/*// @grant GM_addStyle// ==/UserScript== (function () { 'use strict'; console.log('✅ LocalExplorer final universal version loaded'); /* Tooltip & folder cursor */ GM_addStyle(` a[href*="localstorage.com/"], a[href*="localstorage.com"] { cursor: pointer !important; position: relative; } a[href*="localstorage.com/"]::after { content: "📁 Open in File Explorer"; position: absolute; bottom: 100%; left: 0; background: #222; color: #fff; padding: 3px 6px; border-radius: 4px; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(-3px); transition: opacity 0.2s ease; white-space: nowrap; } a[href*="localstorage.com/"]:hover::after { opacity: 1; } `); function toLocalExplorer(url) { if (!url) return null; url = url.trim(); // Strip protocol and domain let pathPart = url.replace(/^https?:\/\/localstorage\.com\/?/i, ''); if (/^localstorage\.com\/?/i.test(pathPart)) pathPart = pathPart.replace(/^localstorage\.com\/?/i, ''); // Strip any leading or trailing slashes or backslashes (flexible) pathPart = pathPart.replace(/^[/\\]+|[/\\]+$/g, ''); // Decode URI (%20 -> space) try { pathPart = decodeURIComponent(pathPart); } catch (e) { console.warn('Decode issue:', e); } // Convert to backslashes pathPart = pathPart.replace(/\//g, '\\'); if (!pathPart) return null; // Final Local Explorer path return `localexplorer:\\\\${pathPart}`; } // --- Click handler --- document.addEventListener( 'click', function (event) { const link = event.target.closest("a[href*='localstorage.com']"); if (!link) return; const originalUrl = link.getAttribute('href'); if (!originalUrl) return; if (!/^https?:\/\/localstorage\.com/i.test(originalUrl) && !/^localstorage\.com/i.test(originalUrl)) return; event.preventDefault(); const localUrl = toLocalExplorer(originalUrl); if (!localUrl) return; console.log(`📂 Opening via click: ${localUrl}`); window.location.href = localUrl; }, true ); // --- Address bar handler --- const current = window.location.href || ''; if (/^(https?:\/\/)?localstorage\.com/i.test(current)) { const localUrl = toLocalExplorer(current); if (localUrl) { console.log(`📂 Opening via address bar: ${localUrl}`); window.location.replace(localUrl); } }})();