Hosted Apps - Verify users came from the Chrome App Menu

15 views
Skip to first unread message

MunsieGames

unread,
Jun 11, 2011, 6:34:01 AM6/11/11
to Chromium Apps
I'm developing an a hosted app and I need to make sure my users can
only access the app if they came from the Chrome "Apps menu" on the
user's computer. In other words, I don't want anyone who didn't
install the app from the Chrome App store, to have access to the app.

The app is free so there's no need to verify payment. I just want to
make sure they are coming to the site from the "app menu" inside the
chrome browser.

Is there a ref tag or something we can use to verify the user actually
has the app installed and is coming from the app menu?

Sorry, if it's easier than it seems, but I searched and couldn't find
anything. Thx!

Brandon Thomson

unread,
Jun 11, 2011, 2:39:33 PM6/11/11
to MunsieGames, Chromium Apps
I think the referrer will be from something like chrome://newtab if
they clicked the app link, I see it in my google analytics reports a
lot.
--
Brandon Thomson
www.bthomson.com

> --
> You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
> To post to this group, send email to chromi...@chromium.org.
> To unsubscribe from this group, send email to chromium-app...@chromium.org.
> For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-apps/?hl=en.
>
>

MunsieGames

unread,
Jun 11, 2011, 7:19:53 PM6/11/11
to Chromium Apps
Thanks for the reply. I wonder if someone bookmarked the page
directly, the ref would be the same? I guess I'll just have to make a
quick app and see how it works. I wonder if using the license api
would let me do this as well, even for a free app?

On Jun 11, 1:39 pm, Brandon Thomson <brandon.j.thom...@gmail.com>
wrote:
> I think the referrer will be from something like chrome://newtab if
> they clicked the app link, I see it in my google analytics reports a
> lot.
> --
> Brandon Thomsonwww.bthomson.com
>
>
>
>
>
>
>
> On Sat, Jun 11, 2011 at 6:34 AM, MunsieGames <munsiega...@yahoo.com> wrote:
> > I'm developing an a hosted app and I need to make sure my users can
> > only access the app if they came from the Chrome "Apps menu" on the
> > user's computer. In other words, I don't want anyone who didn't
> > install the app from the Chrome App store, to have access to the app.
>
> > The app is free so there's no need to verify payment. I just want to
> > make sure they are coming to the site from the "app menu" inside the
> > chrome browser.
>
> > Is there a ref tag or something we can use to verify the user actually
> > has the app installed and is coming from the app menu?
>
> > Sorry, if it's easier than it seems, but I searched and couldn't find
> > anything. Thx!
>
> > --
> > You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
> > To post to this group, send email to chromium-a...@chromium.org.
> > To unsubscribe from this group, send email to chromium-apps+unsubscr...@chromium.org.

Caleb Eggensperger

unread,
Jun 11, 2011, 9:46:26 PM6/11/11
to MunsieGames, Chromium Apps
use this

if (window.chrome && window.chrome.app && window.chrome.app.isInstalled) {
  // do stuff if the app is installed
} else {
  // Redirect the user to the chrome store page
  document.location = app_store_url
}

It's not foolproof, but it's more accurate than the referer. Also, this will evaluate to true even if they typed in the URL or arrived via a link, as long as the app is installed.

To post to this group, send email to chromi...@chromium.org.
To unsubscribe from this group, send email to chromium-app...@chromium.org.



--
Caleb Eggensperger
www.calebegg.com

MunsieGames

unread,
Jun 11, 2011, 10:42:41 PM6/11/11
to Chromium Apps
Awesome thanks, that was I looking for. Now...just so I can better
understand the process, you mention this is not 100% fool proof, can
you give me an example that would cause this to fail? (Allow the user
in even if they do not have the app installed.) Thanks again!

PhistucK

unread,
Jun 12, 2011, 2:19:13 AM6/12/11
to MunsieGames, Chromium Apps
If the anxious technical user takes a look at your source code, they will see this check and very simply override chrome.app with a content/user script/manual JavaScript evaluation so that the condition would be true.

PhistucK



To post to this group, send email to chromi...@chromium.org.
To unsubscribe from this group, send email to chromium-app...@chromium.org.

MunsieGames

unread,
Jun 12, 2011, 10:29:27 AM6/12/11
to Chromium Apps
ahh...ofcourse. Thx. Since it's going to be a free app anyway, I guess
we can live with this. ;)

On Jun 12, 1:19 am, PhistucK <phist...@gmail.com> wrote:
> If the anxious technical user takes a look at your source code, they will
> see this check and very simply override chrome.app with a content/user
> script/manual JavaScript evaluation so that the condition would be true.
>
> ☆*PhistucK*
Reply all
Reply to author
Forward
0 new messages