Sharing LocalStorage between two data directories

394 views
Skip to first unread message

Joshua Kappers

unread,
Dec 7, 2017, 8:45:24 AM12/7/17
to Chromium-discuss
I'm running two instances of chrome on a kiosk device.
 
The application being run communicates between browser instances by sharing localStorage and watching for change events to localStorage.

However, I have two problems:

1. The second window does not position correctly unless I point both instances to different data directories.

start chrome.exe --app="http://google.com"  --kiosk --user-data-dir=C:\monitor1 --window-position=0,0

start chrome.exe --app="http://google.com"  --kiosk --user-data-dir=C:\monitor2 --window-position=1280,0

2. Because I have to change the data directory, localStorage is no longer shared and so the application will not work.

Is there a way I can either:

* Fix the positioning without using different data directories?
* Share the localStorage mechanisms between the two directories?

Julian Pastarmov

unread,
Dec 8, 2017, 9:17:19 AM12/8/17
to Chromium-discuss
Hi,

I think the issue with positioning windows is a bug and I will suggest you file that on http://crbug.com

The other option you mentioned would be possible only if you were using an actual Chrome app and not a website running in an "app" mode. That could then switch to using sync storage rather than local storage which gives you syncing for free between instanced signing in to the same google profile.

Best,
Julian

Joshua Kappers

unread,
Dec 8, 2017, 10:22:07 AM12/8/17
to pasta...@google.com, Chromium-discuss
Thanks Julian!

The positioning issue is a known bug. I was hoping that by now there was some new flag that would work instead (I saw some flags about a secondary screen, but couldn't make sense of them).

I wrote a console app that locates the window and moves it as part of the boot process. Going to test it on the kiosk today.

Good to know about the chrome app. Unfortunately, there's no time. This ship is sailing Monday. o.o

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+unsubscribe@chromium.org.

Torne (Richard Coles)

unread,
Dec 8, 2017, 11:14:39 AM12/8/17
to jo...@jkappers.me, pasta...@google.com, Chromium-discuss
If you *don't* set different user data directories, then you *aren't* actually running two instances of chrome at all: you are running one instance, with two open windows. That's why --window-position doesn't work: when you run chrome.exe the second time it detects the already-running instance and just tells it to start a new window with the given URL, and all command line arguments are ignored other than the ones specifically handled by the code that passes the URL to the existing instance. (there's many command line args that can never be supported in this case; in principle we could handle --window-position and it seems like it'd be nice to, but most flags will never work because they control global things about chrome, not properties of the specific request to open a page).

The synced storage Julian refers to is synced via the Google profile sync servers and requires that they be signed into a google account, and that they be able to access the sync servers, so that may not actually be useful to you either. There's no way to *directly* share the local data; we assume every instance of chrome has exclusive access to everything in the data directory, which is why it behaves as above in the first place.

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.

Reply all
Reply to author
Forward
0 new messages