javascript - Sharing localStorage between web app and extension -
i have "notifications" system which, user permission, pops new notification
complete optional sound effect inform users of things happening.
however there limitation means notifications won't appear when there no browser tabs open, since there no instances of "check notifications" javascript code running.
to remedy this, want make browser extension, first chrome , potentially other browsers.
multiple tabs handled using localstorage
negotiate mutexes , pass data across tabs. result update simultaneously , 1 of them triggers desktop notification / sound effect.
is possible browser extension (again, chrome first, other browsers considered less important this) read same localstorage
web app, , thereby join in communications?
is possible browser extension (again, chrome first, other browsers considered less important this) read same localstorage web app, , thereby join in communications?
yes, while page open. content script share localstorage
page, , there no api access otherwise.
that said, agree comment patrick evans: extension cumbersome solution notifications. new push api great alternative (also works on mobile!), , google codelab great introduction.
Comments
Post a Comment