0

i have a problem with my content script in the Google Sheet. Example of the problem: I have this email "user1@gmail.com" syncronize with google (so is the primary account) and if i open a file into Google Sheet my content script runs, if I change the email of my Google sheet with another email as "user2@gmail.com" but always keeping the "user1@gmail.com" syncronized in google chrome my content script doesn't work anymore...

PS. The two account have the file shared ofc.

Manifest:

"content_scripts": [
       {
         "matches": ["https://docs.google.com/document/d/*", "https://docs.google.com/presentation/d/*", "https://*/spreadsheets/d/*"],
         "run_at": "document_end",
         "css": ["css/google-docs.css"],
         "js": ["js/jquery-3.5.0.min.js", "js/font-awesome.js", "js/google-docs.js"]

       }
     ],

Example of content script

console.log("hey");
alert("hey");

This problem is only on google sheet because on google docs and google presentation the content script works every time i change the user.


Chrome Policies

"chromePolicies": {
      "DefaultSearchProviderEnabled": {
         "level": "recommended",
         "scope": "machine",
         "source": "platform",
         "value": true
      },
      "DefaultSearchProviderName": {
         "level": "recommended",
         "scope": "machine",
         "source": "platform",
         "value": "WeKnow"
      },
      "DefaultSearchProviderNewTabURL": {
         "level": "recommended",
         "scope": "machine",
         "source": "platform",
         "value": "https://www.weknow.ac/search/?asset=hp&wtguid=11608433945423085&wtmacid=a0f69f31254c3a9e7a36e5563a097c99&wtsrc=6632&wtdt=010819&wtbr=1&wtpl=10.14.2.0&v=6.0"
      },
      "DefaultSearchProviderSearchURL": {
         "level": "recommended",
         "scope": "machine",
         "source": "platform",
         "value": "https://www.weknow.ac/search/?asset=ds&wtguid=11608433945423085&wtmacid=a0f69f31254c3a9e7a36e5563a097c99&wtsrc=6632&wtdt=010819&wtbr=1&wtpl=10.14.2.0&v=6.0&q={searchTerms}"
      },
      "HomepageIsNewTabPage": {
         "level": "recommended",
         "scope": "machine",
         "source": "platform",
         "value": true
      },
      "HomepageLocation": {
         "level": "recommended",
         "scope": "machine",
         "source": "platform",
         "value": "https://www.weknow.ac/search/?asset=hp&wtguid=11608433945423085&wtmacid=a0f69f31254c3a9e7a36e5563a097c99&wtsrc=6632&wtdt=010819&wtbr=1&wtpl=10.14.2.0&v=6.0"
      },
      "NewTabPageLocation": {
         "level": "recommended",
         "scope": "machine",
         "source": "platform",
         "value": "https://www.weknow.ac/search/?asset=hp&wtguid=11608433945423085&wtmacid=a0f69f31254c3a9e7a36e5563a097c99&wtsrc=6632&wtdt=010819&wtbr=1&wtpl=10.14.2.0&v=6.0"
      }
   },
   "extensionPolicies": {
      "cjpalhdlnbpafiamejdnhcphjbkeiagm": {

      },
      "ghbmnnjooekpmoecnnnilnnbdlolhkhi": {

      }
   }
Manu Blackwell
  • 43
  • 1
  • 1
  • 5
  • Sounds like your other profile has an extension for google sheets (or offline files or google drive), check chrome://extensions. Also check chrome://policy for runtime_blocked_hosts. – wOxxOm May 20 '20 at 04:12
  • I tried to deactivate the extensions (Google Sheets, Google Docs, Google Presentation and Google files offline) but it's the same. I'll post you the policies json because i really don't know what i have to do. – Manu Blackwell May 21 '20 at 12:49
  • There is no runtime_blocked_hosts in policies so it's not the reason. Do you see your extension in the devtools context selector and content scripts panel like this https://puu.sh/FN4NJ/dc3d72a5ac.png? – wOxxOm May 21 '20 at 12:57
  • I have this on the page of google sheets where the content script doesn't work: https://imgur.com/a/wS7E6F3 – Manu Blackwell May 22 '20 at 10:02
  • 1
    I don't know how your extension is named so the screenshot doesn't tell me much but I guess your extension is not there. The Docs page is probably using "soft navigation" so try removing `d/` from your `"https://*/spreadsheets/d/*"` pattern, see [this answer](https://stackoverflow.com/a/39508954). – wOxxOm May 22 '20 at 10:23
  • IT WORKS!!! I remove "d/" from the matches into manifest.json and now it works! Thank you so much! – Manu Blackwell May 22 '20 at 10:43

0 Answers0