multithreading - Communicate between 2 google chrome processes (tabs) with javascript -
question:
what best way communicate between separate google chrome rendering processes (tabs) without use of web-server?
background:
i writing large application , decided try , migrate whole thing browser. due work google chrome. previous application consisted of c++ based (qt) webserver / calculation engine , browser used gui. have moved calculation engine javascript , run in browser.
the problem gui unstable. stay running 12 hours crash "aw snap" error. before wasn't worried because simple matter of refreshing page. when gui crashes because running in same process calculation engine, crashes also.
details:
the calculation engine web-page spawns number of web-workers. opens gui (a separate webpage) popup window , communicates using postmessage.
the gui typically needs read ~ 500 floating point numbers / second (sent json) calculation engine , write ~ 5 numbers / second.
yesterday got excited because discovered sharedworker api thought accomplish wanted. today however, learned modifications made chrome sharedworker runs in same process attached tabs , forces tabs attached 1 process. apparently didn't used this. know if there browser flags can set revert old behavior?
i have read little bit serviceworkers , other new apis such webrtc. have played around storage apis , thought maybe used 2 separate processes (tabs) communicate @ rates need.
i want solution work locally (using switches --allow-file-access-from-files) , doesn't require plugin installation (since local plugins blocked work).
note: saw other similar questions didn't address need there separate processes (only separate tabs)
well, looks figured out answer already. problem turned out how trying open gui window.
i had link on calculation engine user clicked on open window:
<a href="gui.html" target="_blank">open gui</a>
however, turns out adding rel="noreferrer"
cause chrome open window in new process.
<a href="gui.html" rel="noreferrer" target="_blank">open gui in new process</a>
after figured out, sharedworker began function had expected , able keep engine tab running when gui tab crashed.
Comments
Post a Comment