Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

373
Vistas
geolocation permission doesn't work with Manifest Version 3 Chrome Extension

I want to develop an Chrome Extension which would be compatible with Manifest Version 3, but I run into problem with getting current user's geolocation coordinates, which works with Manifest Version 2, but for Manifest Version 3 it throws that navigator.geolocation is undefined.

Here are my manifest.json and background.js files:

manifest.json:

    "name": "Chrome Extension MV3",
    "description": "Learning all about Chrome Extensions Manifest Version 3!",
    "version": "0.1.0",
    "manifest_version": 2,
    "background": {
        "service_worker": "background.js"
    },
    "permissions": ["geolocation"]
}

background.js:

navigator.geolocation.getCurrentPosition((position) => {
    const { latitude, longitude } = position.coords;
    console.log(latitude, longitude);
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Exact same thing is happening to me.

Works fine in chrome f12 console just not in extension i get the exact same error.

var getlocale = function() {
  var geoSuccess = function(position) {
    latitude = position.coords.latitude;
    longitude = position.coords.longitude;
    console.log(latitude);
    console.log(longitude);
  };
  navigator.geolocation.getCurrentPosition(geoSuccess);
};
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda