Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
La extensión web de Safari no puede enviar un mensaje nativo

Estoy tratando de crear una extensión web de Safari para mi aplicación nativa. Quiero tener una ventana emergente con un botón que, al hacer clic, se comunicará con mi aplicación nativa:

 browser.runtime.sendNativeMessage({message: "Open Main App"}, function(response) { console.log("Received sendNativeMessage response:"); console.log(response); });

Sin embargo, la aplicación no recibe el mensaje enviado desde Safari Web Extension:

 func beginRequest(with context: NSExtensionContext) { its the function that handles all things then if msg.contains("Open Main App") == true { print("NEED TO OPEN") guard let url = URL(string: "player:Vacation?index=1") else { return } NSWorkspace.shared.open(url) }

El registro de Safari mostró este mensaje de error:

 ReferenceError: Can't find variable: browser

¿Qué está mal?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Utilizó browser.runtime.sendNativeMessage del script de fondo? También debe establecer el permiso en el archivo de manifiesto. Así: "permissions": [ "nativeMessaging" ]

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!