Chrome extension gmail API cookiePolicy?
I'm building a chrome extension that will read the user's emails and check them for typos. However, when trying to authenticate the user in my background.js I'm running into this error:
uO message: "Invalid cookiePolicy", stack:
"gapi.auth2.ExternallyVisibleError: Invalid cookieP… at handleResponse
(extensions::sendRequest:67:7)"
Here is how I'm trying to authenticate them:
background.js
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://apis.google.com/js/client.js?onload=callbackFunction";
head.appendChild(script);
chrome.identity.getAuthToken(interactive: true, authorize);
function authorize(token)
gapi.auth.authorize(
client_id: '800382879116-k3luktdc1lmb1e1fml8i8u.apps.googleusercontent.com',
immediate: true,
scope: 'https://www.googleapis.com/auth/gmail.readonly'
,
function(result)
console.log(result);
gapi.client.load('gmail', 'v1', callback);
);
background.html
<!DOCTYPE html>
<html>
<body>
<script src='scripts/background.js'></script>
</body>
</html>
manifest.json
"name": "Gmail Typo Analyzer",
"version": "0.1",
"description": "Gmail Typo Analyzer",
"permissions": [
"identity",
"storage"
],
"content_security_policy": "script-src 'self' https://apis.google.com; object-src 'self'",
"oauth2":
"client_id": "82879116-k3luktdc1li8u.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/userinfo.email"
]
,
"browser_action":
"default_popup": "popup.html",
"default_icon": "images/Icon_16.png"
,
"background":
"page": "background.html",
"persistent": false
,
"icons":
"16": "images/Icon_16.png",
"32": "images/Icon_32.png",
"48": "images/Icon_48.png",
"128": "images/Icon_128.png"
,
"manifest_version": 2,
"key": "c0Kn5f+t92r4P8lmmoDlKtQ6X9Q42UfFtkkiSRBAVMPHnIHqOQvYC67VczJefSNTGpUYa8+wQDFoFj/clH9SfR+BvOGgI6BUVKBNGGoFS"
I'm super lost right now as their doesn't seem to be a definitive guide on achieving what I'm trying to do anywhere. Does anyone know what I might be doing wrong?
javascript google-chrome-extension google-api
add a comment |
I'm building a chrome extension that will read the user's emails and check them for typos. However, when trying to authenticate the user in my background.js I'm running into this error:
uO message: "Invalid cookiePolicy", stack:
"gapi.auth2.ExternallyVisibleError: Invalid cookieP… at handleResponse
(extensions::sendRequest:67:7)"
Here is how I'm trying to authenticate them:
background.js
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://apis.google.com/js/client.js?onload=callbackFunction";
head.appendChild(script);
chrome.identity.getAuthToken(interactive: true, authorize);
function authorize(token)
gapi.auth.authorize(
client_id: '800382879116-k3luktdc1lmb1e1fml8i8u.apps.googleusercontent.com',
immediate: true,
scope: 'https://www.googleapis.com/auth/gmail.readonly'
,
function(result)
console.log(result);
gapi.client.load('gmail', 'v1', callback);
);
background.html
<!DOCTYPE html>
<html>
<body>
<script src='scripts/background.js'></script>
</body>
</html>
manifest.json
"name": "Gmail Typo Analyzer",
"version": "0.1",
"description": "Gmail Typo Analyzer",
"permissions": [
"identity",
"storage"
],
"content_security_policy": "script-src 'self' https://apis.google.com; object-src 'self'",
"oauth2":
"client_id": "82879116-k3luktdc1li8u.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/userinfo.email"
]
,
"browser_action":
"default_popup": "popup.html",
"default_icon": "images/Icon_16.png"
,
"background":
"page": "background.html",
"persistent": false
,
"icons":
"16": "images/Icon_16.png",
"32": "images/Icon_32.png",
"48": "images/Icon_48.png",
"128": "images/Icon_128.png"
,
"manifest_version": 2,
"key": "c0Kn5f+t92r4P8lmmoDlKtQ6X9Q42UfFtkkiSRBAVMPHnIHqOQvYC67VczJefSNTGpUYa8+wQDFoFj/clH9SfR+BvOGgI6BUVKBNGGoFS"
I'm super lost right now as their doesn't seem to be a definitive guide on achieving what I'm trying to do anywhere. Does anyone know what I might be doing wrong?
javascript google-chrome-extension google-api
I want to refer this SO post where the OP solved the problem about CORS and suggested to use this extension.
– jess
Nov 15 '18 at 10:37
Try changing the permission to"https://apis.google.com/"
- you can't specify a path there.
– Xan
Nov 15 '18 at 11:36
Have you seen this SO Q&A?
– Iván Nokonoko
Nov 23 '18 at 14:26
Bothcallback
andcallbackFunction
are undefined in your code. You never check nor use thetoken
.
– Iván Nokonoko
Nov 23 '18 at 15:01
@IvánNokonoko I saw that. But I want my chrome extension to run on the user's browser, not on some webserver I host.
– MarksCode
Nov 23 '18 at 18:49
add a comment |
I'm building a chrome extension that will read the user's emails and check them for typos. However, when trying to authenticate the user in my background.js I'm running into this error:
uO message: "Invalid cookiePolicy", stack:
"gapi.auth2.ExternallyVisibleError: Invalid cookieP… at handleResponse
(extensions::sendRequest:67:7)"
Here is how I'm trying to authenticate them:
background.js
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://apis.google.com/js/client.js?onload=callbackFunction";
head.appendChild(script);
chrome.identity.getAuthToken(interactive: true, authorize);
function authorize(token)
gapi.auth.authorize(
client_id: '800382879116-k3luktdc1lmb1e1fml8i8u.apps.googleusercontent.com',
immediate: true,
scope: 'https://www.googleapis.com/auth/gmail.readonly'
,
function(result)
console.log(result);
gapi.client.load('gmail', 'v1', callback);
);
background.html
<!DOCTYPE html>
<html>
<body>
<script src='scripts/background.js'></script>
</body>
</html>
manifest.json
"name": "Gmail Typo Analyzer",
"version": "0.1",
"description": "Gmail Typo Analyzer",
"permissions": [
"identity",
"storage"
],
"content_security_policy": "script-src 'self' https://apis.google.com; object-src 'self'",
"oauth2":
"client_id": "82879116-k3luktdc1li8u.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/userinfo.email"
]
,
"browser_action":
"default_popup": "popup.html",
"default_icon": "images/Icon_16.png"
,
"background":
"page": "background.html",
"persistent": false
,
"icons":
"16": "images/Icon_16.png",
"32": "images/Icon_32.png",
"48": "images/Icon_48.png",
"128": "images/Icon_128.png"
,
"manifest_version": 2,
"key": "c0Kn5f+t92r4P8lmmoDlKtQ6X9Q42UfFtkkiSRBAVMPHnIHqOQvYC67VczJefSNTGpUYa8+wQDFoFj/clH9SfR+BvOGgI6BUVKBNGGoFS"
I'm super lost right now as their doesn't seem to be a definitive guide on achieving what I'm trying to do anywhere. Does anyone know what I might be doing wrong?
javascript google-chrome-extension google-api
I'm building a chrome extension that will read the user's emails and check them for typos. However, when trying to authenticate the user in my background.js I'm running into this error:
uO message: "Invalid cookiePolicy", stack:
"gapi.auth2.ExternallyVisibleError: Invalid cookieP… at handleResponse
(extensions::sendRequest:67:7)"
Here is how I'm trying to authenticate them:
background.js
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://apis.google.com/js/client.js?onload=callbackFunction";
head.appendChild(script);
chrome.identity.getAuthToken(interactive: true, authorize);
function authorize(token)
gapi.auth.authorize(
client_id: '800382879116-k3luktdc1lmb1e1fml8i8u.apps.googleusercontent.com',
immediate: true,
scope: 'https://www.googleapis.com/auth/gmail.readonly'
,
function(result)
console.log(result);
gapi.client.load('gmail', 'v1', callback);
);
background.html
<!DOCTYPE html>
<html>
<body>
<script src='scripts/background.js'></script>
</body>
</html>
manifest.json
"name": "Gmail Typo Analyzer",
"version": "0.1",
"description": "Gmail Typo Analyzer",
"permissions": [
"identity",
"storage"
],
"content_security_policy": "script-src 'self' https://apis.google.com; object-src 'self'",
"oauth2":
"client_id": "82879116-k3luktdc1li8u.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/userinfo.email"
]
,
"browser_action":
"default_popup": "popup.html",
"default_icon": "images/Icon_16.png"
,
"background":
"page": "background.html",
"persistent": false
,
"icons":
"16": "images/Icon_16.png",
"32": "images/Icon_32.png",
"48": "images/Icon_48.png",
"128": "images/Icon_128.png"
,
"manifest_version": 2,
"key": "c0Kn5f+t92r4P8lmmoDlKtQ6X9Q42UfFtkkiSRBAVMPHnIHqOQvYC67VczJefSNTGpUYa8+wQDFoFj/clH9SfR+BvOGgI6BUVKBNGGoFS"
I'm super lost right now as their doesn't seem to be a definitive guide on achieving what I'm trying to do anywhere. Does anyone know what I might be doing wrong?
javascript google-chrome-extension google-api
javascript google-chrome-extension google-api
edited Nov 28 '18 at 7:41
MarksCode
asked Nov 14 '18 at 22:15
MarksCodeMarksCode
1,21011855
1,21011855
I want to refer this SO post where the OP solved the problem about CORS and suggested to use this extension.
– jess
Nov 15 '18 at 10:37
Try changing the permission to"https://apis.google.com/"
- you can't specify a path there.
– Xan
Nov 15 '18 at 11:36
Have you seen this SO Q&A?
– Iván Nokonoko
Nov 23 '18 at 14:26
Bothcallback
andcallbackFunction
are undefined in your code. You never check nor use thetoken
.
– Iván Nokonoko
Nov 23 '18 at 15:01
@IvánNokonoko I saw that. But I want my chrome extension to run on the user's browser, not on some webserver I host.
– MarksCode
Nov 23 '18 at 18:49
add a comment |
I want to refer this SO post where the OP solved the problem about CORS and suggested to use this extension.
– jess
Nov 15 '18 at 10:37
Try changing the permission to"https://apis.google.com/"
- you can't specify a path there.
– Xan
Nov 15 '18 at 11:36
Have you seen this SO Q&A?
– Iván Nokonoko
Nov 23 '18 at 14:26
Bothcallback
andcallbackFunction
are undefined in your code. You never check nor use thetoken
.
– Iván Nokonoko
Nov 23 '18 at 15:01
@IvánNokonoko I saw that. But I want my chrome extension to run on the user's browser, not on some webserver I host.
– MarksCode
Nov 23 '18 at 18:49
I want to refer this SO post where the OP solved the problem about CORS and suggested to use this extension.
– jess
Nov 15 '18 at 10:37
I want to refer this SO post where the OP solved the problem about CORS and suggested to use this extension.
– jess
Nov 15 '18 at 10:37
Try changing the permission to
"https://apis.google.com/"
- you can't specify a path there.– Xan
Nov 15 '18 at 11:36
Try changing the permission to
"https://apis.google.com/"
- you can't specify a path there.– Xan
Nov 15 '18 at 11:36
Have you seen this SO Q&A?
– Iván Nokonoko
Nov 23 '18 at 14:26
Have you seen this SO Q&A?
– Iván Nokonoko
Nov 23 '18 at 14:26
Both
callback
and callbackFunction
are undefined in your code. You never check nor use the token
.– Iván Nokonoko
Nov 23 '18 at 15:01
Both
callback
and callbackFunction
are undefined in your code. You never check nor use the token
.– Iván Nokonoko
Nov 23 '18 at 15:01
@IvánNokonoko I saw that. But I want my chrome extension to run on the user's browser, not on some webserver I host.
– MarksCode
Nov 23 '18 at 18:49
@IvánNokonoko I saw that. But I want my chrome extension to run on the user's browser, not on some webserver I host.
– MarksCode
Nov 23 '18 at 18:49
add a comment |
2 Answers
2
active
oldest
votes
You didn't post your manifest.json
file, where you would set the oauth2
credentials, so I would try something like:
manifest.json
...
"oauth2" : "client_id": "800382879116-k3luktdc1lmb1e1fml8i8u.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/gmail.readonly"
]
...
background.js
chrome.identity.getAuthToken(interactive: true, authorize);
function authorize(token)
if (token)
//user has given authorization, use token for requests.
//...
else
//no authorization received.
console.log('No authorization. Error: ' + chrome.runtime.lastError);
;
And you don't need to load Google API client, you can access Gmail's Restful API with XMLHttpRequest
s or Fetch API.
add a comment |
I used to get that cookie error too, but for Chrome extensions I only know how to load them from unpacked in the Extensions tab. So using gapi directly never worked for me.
As Ivan mentioned, Chrome extensions have this support "built-in" by setting the "oauth2" section in the manifest. Then you can call the APIs directly with Ajax like Ivan's example.
To build on Ivan's example, this is my working code to get a list of contacts. I haven't read from the XHR object yet, but Fiddler confirms that the data is coming back fine without any cookie or CORS errors. Of course make sure you enable these APIs in console.developers.google.com.
chrome.identity.getAuthToken( interactive: true , authorize);
function authorize(token)
if (token)
console.log(token);
var xhr = new XMLHttpRequest();
xhr.open('GET',
"https://people.googleapis.com/v1/people/me/connections?personFields=names");
xhr.setRequestHeader('Authorization',
'Bearer ' + token);
xhr.send();
//user has given authorization, use token for requests.
//...
else
console.log('No authorization. Error: ' + chrome.runtime.lastError);
;
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309556%2fchrome-extension-gmail-api-cookiepolicy%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You didn't post your manifest.json
file, where you would set the oauth2
credentials, so I would try something like:
manifest.json
...
"oauth2" : "client_id": "800382879116-k3luktdc1lmb1e1fml8i8u.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/gmail.readonly"
]
...
background.js
chrome.identity.getAuthToken(interactive: true, authorize);
function authorize(token)
if (token)
//user has given authorization, use token for requests.
//...
else
//no authorization received.
console.log('No authorization. Error: ' + chrome.runtime.lastError);
;
And you don't need to load Google API client, you can access Gmail's Restful API with XMLHttpRequest
s or Fetch API.
add a comment |
You didn't post your manifest.json
file, where you would set the oauth2
credentials, so I would try something like:
manifest.json
...
"oauth2" : "client_id": "800382879116-k3luktdc1lmb1e1fml8i8u.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/gmail.readonly"
]
...
background.js
chrome.identity.getAuthToken(interactive: true, authorize);
function authorize(token)
if (token)
//user has given authorization, use token for requests.
//...
else
//no authorization received.
console.log('No authorization. Error: ' + chrome.runtime.lastError);
;
And you don't need to load Google API client, you can access Gmail's Restful API with XMLHttpRequest
s or Fetch API.
add a comment |
You didn't post your manifest.json
file, where you would set the oauth2
credentials, so I would try something like:
manifest.json
...
"oauth2" : "client_id": "800382879116-k3luktdc1lmb1e1fml8i8u.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/gmail.readonly"
]
...
background.js
chrome.identity.getAuthToken(interactive: true, authorize);
function authorize(token)
if (token)
//user has given authorization, use token for requests.
//...
else
//no authorization received.
console.log('No authorization. Error: ' + chrome.runtime.lastError);
;
And you don't need to load Google API client, you can access Gmail's Restful API with XMLHttpRequest
s or Fetch API.
You didn't post your manifest.json
file, where you would set the oauth2
credentials, so I would try something like:
manifest.json
...
"oauth2" : "client_id": "800382879116-k3luktdc1lmb1e1fml8i8u.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/gmail.readonly"
]
...
background.js
chrome.identity.getAuthToken(interactive: true, authorize);
function authorize(token)
if (token)
//user has given authorization, use token for requests.
//...
else
//no authorization received.
console.log('No authorization. Error: ' + chrome.runtime.lastError);
;
And you don't need to load Google API client, you can access Gmail's Restful API with XMLHttpRequest
s or Fetch API.
answered Nov 23 '18 at 15:01
Iván NokonokoIván Nokonoko
2,7332613
2,7332613
add a comment |
add a comment |
I used to get that cookie error too, but for Chrome extensions I only know how to load them from unpacked in the Extensions tab. So using gapi directly never worked for me.
As Ivan mentioned, Chrome extensions have this support "built-in" by setting the "oauth2" section in the manifest. Then you can call the APIs directly with Ajax like Ivan's example.
To build on Ivan's example, this is my working code to get a list of contacts. I haven't read from the XHR object yet, but Fiddler confirms that the data is coming back fine without any cookie or CORS errors. Of course make sure you enable these APIs in console.developers.google.com.
chrome.identity.getAuthToken( interactive: true , authorize);
function authorize(token)
if (token)
console.log(token);
var xhr = new XMLHttpRequest();
xhr.open('GET',
"https://people.googleapis.com/v1/people/me/connections?personFields=names");
xhr.setRequestHeader('Authorization',
'Bearer ' + token);
xhr.send();
//user has given authorization, use token for requests.
//...
else
console.log('No authorization. Error: ' + chrome.runtime.lastError);
;
add a comment |
I used to get that cookie error too, but for Chrome extensions I only know how to load them from unpacked in the Extensions tab. So using gapi directly never worked for me.
As Ivan mentioned, Chrome extensions have this support "built-in" by setting the "oauth2" section in the manifest. Then you can call the APIs directly with Ajax like Ivan's example.
To build on Ivan's example, this is my working code to get a list of contacts. I haven't read from the XHR object yet, but Fiddler confirms that the data is coming back fine without any cookie or CORS errors. Of course make sure you enable these APIs in console.developers.google.com.
chrome.identity.getAuthToken( interactive: true , authorize);
function authorize(token)
if (token)
console.log(token);
var xhr = new XMLHttpRequest();
xhr.open('GET',
"https://people.googleapis.com/v1/people/me/connections?personFields=names");
xhr.setRequestHeader('Authorization',
'Bearer ' + token);
xhr.send();
//user has given authorization, use token for requests.
//...
else
console.log('No authorization. Error: ' + chrome.runtime.lastError);
;
add a comment |
I used to get that cookie error too, but for Chrome extensions I only know how to load them from unpacked in the Extensions tab. So using gapi directly never worked for me.
As Ivan mentioned, Chrome extensions have this support "built-in" by setting the "oauth2" section in the manifest. Then you can call the APIs directly with Ajax like Ivan's example.
To build on Ivan's example, this is my working code to get a list of contacts. I haven't read from the XHR object yet, but Fiddler confirms that the data is coming back fine without any cookie or CORS errors. Of course make sure you enable these APIs in console.developers.google.com.
chrome.identity.getAuthToken( interactive: true , authorize);
function authorize(token)
if (token)
console.log(token);
var xhr = new XMLHttpRequest();
xhr.open('GET',
"https://people.googleapis.com/v1/people/me/connections?personFields=names");
xhr.setRequestHeader('Authorization',
'Bearer ' + token);
xhr.send();
//user has given authorization, use token for requests.
//...
else
console.log('No authorization. Error: ' + chrome.runtime.lastError);
;
I used to get that cookie error too, but for Chrome extensions I only know how to load them from unpacked in the Extensions tab. So using gapi directly never worked for me.
As Ivan mentioned, Chrome extensions have this support "built-in" by setting the "oauth2" section in the manifest. Then you can call the APIs directly with Ajax like Ivan's example.
To build on Ivan's example, this is my working code to get a list of contacts. I haven't read from the XHR object yet, but Fiddler confirms that the data is coming back fine without any cookie or CORS errors. Of course make sure you enable these APIs in console.developers.google.com.
chrome.identity.getAuthToken( interactive: true , authorize);
function authorize(token)
if (token)
console.log(token);
var xhr = new XMLHttpRequest();
xhr.open('GET',
"https://people.googleapis.com/v1/people/me/connections?personFields=names");
xhr.setRequestHeader('Authorization',
'Bearer ' + token);
xhr.send();
//user has given authorization, use token for requests.
//...
else
console.log('No authorization. Error: ' + chrome.runtime.lastError);
;
answered Jan 31 at 19:19
Sam RobertsonSam Robertson
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309556%2fchrome-extension-gmail-api-cookiepolicy%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I want to refer this SO post where the OP solved the problem about CORS and suggested to use this extension.
– jess
Nov 15 '18 at 10:37
Try changing the permission to
"https://apis.google.com/"
- you can't specify a path there.– Xan
Nov 15 '18 at 11:36
Have you seen this SO Q&A?
– Iván Nokonoko
Nov 23 '18 at 14:26
Both
callback
andcallbackFunction
are undefined in your code. You never check nor use thetoken
.– Iván Nokonoko
Nov 23 '18 at 15:01
@IvánNokonoko I saw that. But I want my chrome extension to run on the user's browser, not on some webserver I host.
– MarksCode
Nov 23 '18 at 18:49