Can a Chrome packaged app and a Chrome extension share local data? - google-chrome

From what I gather, Chrome apps and Chrome extensions are just two different ways of viewing some basic html/js/css files that have access to certain Chrome APIs. What I'd like to know is - can you share data between them? For example, can I do localStorage.setItem('name', 'john'); in a Chrome app, and have localStorage.getItem('name'); return john in an extension? If so, how do I link the app and the extension so that this is possible?

Related

Full Website Within Chrome Application Window

Was wondering if I had a web-application on www.mydomain.com/userportal etc but didn't want this accessable via the browser, but as a chrome application similar to how Google's Hangouts is a seperate window / popup - How easy is it to implement an already built application into one of these windows?
If I understand you correctly, you would like to display your www site as a Chrome App. Chrome apps are all HTML/CSS/JS files hosted on the computer but they can display a webview into a site online. However, Chrome Apps must be 'offline' first. So you must ask for permissions to all online activity.
Ideally you would make separate app hosted as a Chrome App (not link/embedded to a www site) that uses an API to talk to a web-app.
Keep in mind that Google is phasing out Chrome Apps for all platforms except Chrome OS in the near future.

Chrome App Store Manifest vs Web App Manifest

I'm trying to publish my web app to the Chrome App store. I'm confused by Step 2: Create a manifest file . Is this manifest file also a Web App manifest?
If they are different, does it mean that i need to have two manifest.json files, if I intend to also make it a progressive web app while also listing on Chrome App store? How should I go about doing this? Thanks.
No, it is a different format, though they do share some common keys. (such as name, short_name)

Chrome Extension equivalent to Android's INSTALL_REFERRER

Is there a way to detect where a chrome extension installation was referred from. In case you want to rebrand the extension based on where the user came from
Android Apps are capable of this using intent com.android.vending.INSTALL_REFERRER and a referrer=something querystring on their Google Play URL, but I've been unable to find anything similar for Chrome Extensions.
I can probably do a 80% solution with cookies and redirects but it would be nice if this worked as cleanly as in Android INSTALL_REFERRER
It seems that there is no referrer option for Chrome Extensions and it is not listed in the documentation. See the following link for the closest I've found.
https://developer.chrome.com/extensions/runtime#type-OnInstalledReason
A workaround for this would be to pull the data from Google Analytics using the API. Referrals are recorded in Google Analytics for my Chrome Extension:

Enable Chrome Extensions in Google Chrome App webview

I'm building a Google Apps Chrome App (not extension but app) with gmail, calendar, etc.
I would like to run extensions from regular chrome in my app. For example, rapportive is a fantastic extension for gmail. But it seems that extensions do not run on pages hosted in a webview.
Does anyone have an idea of how enable extensions in chrome apps?
Extensions in Chrome Apps aren't available by design. A webview is meant to facilitate displaying web-based content that you control, in which case you'd have the ability to alter that content at the server, rather than relying on an extension to do so.
Incidentally, you should take note of the applicable terms of service, which won't let you publish the app you've described in the Chrome Web Store: "Do not post an app where the primary functionality is to link to a website not owned by the developer."

How to open links using a chrome app? (Similar to how Android prompts you on what app you want to use to handle certain URLs)

I have a chrome app which displays data pulled from website A.
If a user has the app installed, and is on website A, how can I make the chrome app detect that the user is on website A and then prompt the user to open website A in the chrome app?
I'm trying to mimic how Android does this if you try to open a Google Play Store URL for example.
Thanks in advance,
Dimitry
Your app needs to define a webRequest (part of permissions) in the manifest file. You might use the blocking response to then handle all the stuff yourself.