Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

221
Visualizações
Chrome Notifications API for Extension on Mac not working

This is for a Chrome extension.

The following docs have been taking into account: Chrome Notification API

The following 3 files for example of problem:

Manifest:

{
  "name": "Title",
  "description": "desc",
  "version": "1.1",
  "manifest_version": 3,
  "background": {
    "service_worker": "bg_page.js"
  },
  "permissions": ["notifications"],
  "content_scripts": [
  {
    "matches": [
      "<all_urls>"
    ],
    "js": ["contents.js"]
  }
  ]

}

content.js

// content.js

tld = 'com';

var url = 'https://stackoverflow.com';

console.log(url);

chrome.runtime.sendMessage({
    action: 'xhttp',
    url: url,
    tld: tld
}, function(responseText) {
    console.log(responseText);
    //handleCallback(responseText);
    //console.log(responseText);
    /*Callback function to deal with the response*/
});

bg_page.js

chrome.runtime.onMessage.addListener(function(request, sender, callback) {

    var name = 'test' + (Math.floor(Math.random() * 10000)).toString() + 'v5';

    chrome.notifications.create(name, {
        type: 'basic',
        iconUrl: 'https://i.picsum.photos/id/919/536/354.jpg?hmac=NQVTG38LLhSmuQu5ztuZ846sqRtDy4nzwI-1C457j-o',
        title: 'Test',
        message: 'Current Name: ' + name,
        priority: 2,
        }
    );
    console.log('test');

    console.log(name);

  return true;
}); 

The above works in Chrome on Windows, but not on Mac with version 95 of chrome (and possibly others as well).

So my question is:

Why does this not work on Mac with new versions of Chrome?

The Extention should show a Desktop notification everytime a site is visited in this test case.

Note: Has been tested on 3 seperate Macs.

It might also not work on older versions, has not been tested, but im only focussing on newer versions/newest version of Chrome.

The following has been tested and discussed:

  • Permission issue between Chrome and Mac - has been tested on 3 different Macs, all with same result, and not working.
  • Permission issue between Chrome and Site - but since it should work on all sites in the test code above, this shouldn't be the case. Has also been tested and confirmed, and problem still exists.

So im out of ideas.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda