0

I'm using Google Developer Console and Oauth to develop a chrome extension so that user can login by google account.But I can not redirect to url like this

chrome-extension://<id>.

So how can this be solved ?

PG1
  • 1,220
  • 2
  • 12
  • 27
Icom2015
  • 59
  • 2
  • 3

2 Answers2

1

I know this is an older question, but I wondered too. You have to use the built in chrome API for accessing your extension's HTML.

chrome.extension.getURL('options.html')
Virmundi
  • 2,497
  • 3
  • 25
  • 34
0

Send redirect url from a content script to a background page:

chrome.extension.sendRequest({redirect: "http://redirect"});

In a background page update tab's url which would cause redirect:

chrome.extension.onRequest.addListener(function(request, sender) {
    chrome.tabs.update(sender.tab.id, {url: request.redirect});
});

Refer: How do I redirect to a URL using a Google Chrome Extension & Content Script?

Community
  • 1
  • 1
Okky
  • 10,338
  • 15
  • 75
  • 122