Coronavirus-Chrome-Extension icon indicating copy to clipboard operation
Coronavirus-Chrome-Extension copied to clipboard

How to add exemption for google.com?

Open AndriusVegan opened this issue 4 years ago • 3 comments

Great info, however, I encountered a problem, if you search 'coronavirus' on google in chrome, all results are blocked by this extension, so for this extension to work, youneed to enter specific URL (open a specific webpage that contains the word 'coronavirus'. Any ways to go around it? I guess, need to add url exemption for google.com

AndriusVegan avatar Feb 07 '20 18:02 AndriusVegan

This is expected behavior since the extension is meant to block any text of coronavirus.

On Fri, Feb 7, 2020, 12:04 PM AndriusVegan [email protected] wrote:

Great info, however, I encountered a problem, if you search 'coronavirus' on google in chrome, all results are blocked by this extension, so for this extension to work, youneed to enter specific URL (open a specific webpage that contains the word 'coronavirus'. Any ways to go around it? I guess, need to add url exemption for google.com

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WebDevSimplified/Coronavirus-Chrome-Extension/issues/2?email_source=notifications&email_token=AJPAR2ZOOIYRRRVBSY255C3RBWPDHA5CNFSM4KRSTYFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IL4HQ7A, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPAR23LANKVKBDNM2IJLTTRBWPDHANCNFSM4KRSTYFA .

WebDevSimplified avatar Feb 07 '20 18:02 WebDevSimplified

Prevent the replace to occur in SCRIPT or NOSCRIPT tags due to Google's markup

const tagsToIgnore = ['SCRIPT', 'NOSCRIPT', 'STYLE', 'SOURCE']
function replaceText(element) {
  if (tagsToIgnore.includes(element.nodeName)) return
// ...

micalevisk avatar Mar 31 '20 18:03 micalevisk

Hi @AndriusVegan "exclude_matches": ["*://.google.com/*"], Please add this code to your manifest.json file,This will exclude google.com and its child as well as parent URLs.

I Have Shared you the full code just replace yours's with the new one given below

{
  "manifest_version": 2,
  "name": "Coronavirus Immunity",
  "version": "0.1.0",
  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["script.js"],
      "exclude_matches": ["*://.google.com/*"],
      "css": ["styles.css"]
    }
  ]
}

OrginalAkilan avatar Jan 20 '22 13:01 OrginalAkilan