Chrome extension gmail API cookiePolicy?










9















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?










share|improve this question
























  • 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 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















9















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?










share|improve this question
























  • 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 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













9












9








9


1






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?










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 28 '18 at 7:41







MarksCode

















asked Nov 14 '18 at 22:15









MarksCodeMarksCode

1,26212055




1,26212055












  • 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 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

















  • 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 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
















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












2 Answers
2






active

oldest

votes


















4














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 XMLHttpRequests or Fetch API.






share|improve this answer






























    0














    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);

    ;





    share|improve this answer






















      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
      );



      );













      draft saved

      draft discarded


















      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









      4














      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 XMLHttpRequests or Fetch API.






      share|improve this answer



























        4














        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 XMLHttpRequests or Fetch API.






        share|improve this answer

























          4












          4








          4







          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 XMLHttpRequests or Fetch API.






          share|improve this answer













          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 XMLHttpRequests or Fetch API.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 23 '18 at 15:01









          Iván NokonokoIván Nokonoko

          2,7832613




          2,7832613























              0














              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);

              ;





              share|improve this answer



























                0














                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);

                ;





                share|improve this answer

























                  0












                  0








                  0







                  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);

                  ;





                  share|improve this answer













                  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);

                  ;






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 31 at 19:19









                  Sam RobertsonSam Robertson

                  1




                  1



























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      這個網誌中的熱門文章

                      How to read a connectionString WITH PROVIDER in .NET Core?

                      Node.js Script on GitHub Pages or Amazon S3

                      Museum of Modern and Contemporary Art of Trento and Rovereto