mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
BrowserStorage: Use path to make unique item names for non-file URIs
Previously, we were only using the path to disambiguate files on a file:// URI. That meant that all wikis on tiddlywiki.com was sharing the same pool of local storage...
This commit is contained in:
parent
0e6855eba8
commit
2710fae71d
@ -23,7 +23,7 @@ if(Object.prototype.hasOwnProperty.call($tw.hooks.names,hookName)) {
|
|||||||
|
|
||||||
// Load tiddlers from browser storage
|
// Load tiddlers from browser storage
|
||||||
function hookBootTiddlersLoaded() {
|
function hookBootTiddlersLoaded() {
|
||||||
var url = window.location.protocol === "file:" ? window.location.pathname : "",
|
var url = window.location.pathname,
|
||||||
log = [];
|
log = [];
|
||||||
// Step through each browsder storage item
|
// Step through each browsder storage item
|
||||||
for(var index=0; index<window.localStorage.length; index++) {
|
for(var index=0; index<window.localStorage.length; index++) {
|
||||||
|
@ -26,8 +26,7 @@ var SAVE_FILTER_TITLE = "$:/config/BrowserStorage/SaveFilter",
|
|||||||
exports.startup = function() {
|
exports.startup = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
// Compute our prefix for local storage keys
|
// Compute our prefix for local storage keys
|
||||||
var url = window.location.protocol === "file:" ? window.location.pathname : "",
|
var prefix = "tw5#" + window.location.pathname + "#";
|
||||||
prefix = "tw5#" + url + "#";
|
|
||||||
// Make a logger
|
// Make a logger
|
||||||
var logger = new $tw.utils.Logger("browser-storage",{
|
var logger = new $tw.utils.Logger("browser-storage",{
|
||||||
colour: "cyan"
|
colour: "cyan"
|
||||||
|
Loading…
Reference in New Issue
Block a user