1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // For open-source builds, the redirect URL ends in /dev. For official builds,
6 // it ends in /rel/{extension-id}. This distinction is handled by the manifest;
7 // all we have to do here is check the extension id in the case that there is
8 // one, to allow the official beta and dev channels to co-exist.
10 var extensionId = chrome.i18n.getMessage('@@extension_id');
11 var officialPath = '/talkgadget/oauth/chrome-remote-desktop/rel/' + extensionId;
12 var unofficialPath = '/talkgadget/oauth/chrome-remote-desktop/dev';
14 if (window.location.pathname == officialPath ||
15 window.location.pathname == unofficialPath) {
16 window.location.replace(
17 chrome.extension.getURL('oauth2_callback.html') + window.location.search);