For storage purposes, you could use IndexedDB and create a database for 
each wiki isolated by taking the hash of the URL (which is easy to get via 
JS) and using that for the DB name. It doesn't really add any security, but 
it does avoid accidental clobbering. The downside to this approach is you 
would have to use IndexedDB which is a really horrible and confusing API.

On Sunday, February 6, 2022 at 10:17:03 AM UTC-8 hww...@gmail.com wrote:

> I think you are other right track.
>
> I've even gone so far as to mention aspects of this to Jeremy.
>
> Get Outlook for Android <https://aka.ms/AAb9ysg>
> ------------------------------
> *From:* tiddl...@googlegroups.com <tiddl...@googlegroups.com> on behalf 
> of Charlie Veniot <cj.v...@gmail.com>
> *Sent:* Sunday, February 6, 2022 12:52:33 PM
> *To:* TiddlyWiki <tiddl...@googlegroups.com>
> *Subject:* [tw5] Re: GetLocalStorageItem javascript macro 
>  
> I am no internet expert, so not sure if and when I'm using the right 
> language. 
>
> Let's say we have two web pages (say one is some TiddlyWiki, say the other 
> is a TiddlyWiki with BASIC Anywhere Machine).  For them (and however many 
> others) to share data via local storage, they must all be in the same 
> origin.  That origin could be any web host at all, as long as all the web 
> pages are from the same IP and port (if I understand correctly?)
>
> I'd say as per the Same-origin policy 
> <https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy> 
> documentation 
> at MDN Web Docs.
>
> If a web browser allows local storage at localhost (i.e. the hard drive on 
> your computer), then all TiddlyWiki instances and whatever other local web 
> pages on your computer are accessing the same local storage.
>
> Something like that ...
> On Sunday, February 6, 2022 at 9:35:58 AM UTC-4 hww...@gmail.com wrote:
>
> I am assuming that "as long as they are both in the same domain" applies 
> to a googleDrive environment as well as your ...neocities... domain.  
> Please let me know if that is NOT a valid assumption.  In the mean time, I 
> am going to ponder some "back-up" considerations that are nagging at me. 
>
> Cheers,
> Hans
>
>
> On Saturday, February 5, 2022 at 11:31:24 PM UTC-5 cj.v...@gmail.com 
> wrote:
>
> Arg, I totally borked the export of that file.  (The file on my local 
> drive is empty.) 
>
> Thanks for catching that.
>
> Instead, sneak a peek at both javascript macros (GetLocalStorageItem and 
> SetLocalStorageItem) here: 
> https://basicanywheremachine.neocities.org/LocalStoragePrototype.html
>
> That TiddlyWiki is to demonstrate not just local storage in TiddlyWiki, 
> but a way for a BASIC program and a TiddlyWiki instance can exchange data 
> via local storage, as long as they are both in the same domain.
>
> On Saturday, February 5, 2022 at 11:32:43 PM UTC-4 dyllon...@gmail.com 
> wrote:
>
> Even in Google Groups, your attachment is empty. I would recommend 
> pastebin or making a GitHub gist.
>
> On Saturday, February 5, 2022 at 1:45:02 PM UTC-8 cj.v...@gmail.com wrote:
>
> https://groups.google.com/g/tiddlywiki/c/mOm62AUaz8c
>
> On Saturday, February 5, 2022 at 5:44:36 PM UTC-4 Charlie Veniot wrote:
>
> I don't have much experience with javascript macros, but I know just 
> enough to be dangerous... 
>
> So FYI, just a simple javascript macro example for anybody interested in 
> this kind of thing.
>
> See attached text file.
>
> (I'll follow this up with a link to this Google Post, in case the 
> attachment does not show in TiddlyTalk.)
>
>
> -- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/tiddlywiki/mOm62AUaz8c/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> tiddlywiki+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/502a011a-f03a-40ee-aba2-5ec2883fd6b0n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/502a011a-f03a-40ee-aba2-5ec2883fd6b0n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/bb876d7d-3a8f-444e-a439-66ce53ea704bn%40googlegroups.com.

Reply via email to