Questions tagged [safari-extension]

A legacy API to extend Apple's Safari web browser. As of Safari 14/MacOS 11, a framework named Safari Web Extension implements the standard browser extension APIs. Safari App Extensions, introduced with MacOS 10.12 ("Sierra"), is aimed at integration of native applications with the browser.

Safari Extensions is the term Apple used for a legacy API to extend the browser. As of MacOS 11, Safari Web Extensions (safari-web-extension) is the official framework to implement browser extensions in JS, while Safari App Extensions (safari-app-extension) focus on the integration of native applications with the browser and their communication.

Legacy documentation can be found starting at the Safari Extensions Development Guide.

662 questions
5
votes
3 answers

-webkit-transform CSS Properties Hose Font Rendering

This question is pretty much the same as this one except that I'm seeing it exclusively in Safari on Mac (the only platform I need to care about). It's definitely CSS-related and I think I've narrowed it down to a few properties which seem to wreak…
Rob Wilkerson
  • 40,476
  • 42
  • 137
  • 192
5
votes
2 answers

Safari extension running injected javascript multiple times

I have copied the code from the following example on the Apple Developer…
Craig Siemens
  • 12,942
  • 1
  • 34
  • 51
5
votes
2 answers

Safari extension - Too many injected scripts responding to message

I am trying to code a safari extension similar to Bubble Translate for Chrome. when you click a button on the toolbar, it automatically translates the text currently selected to the language of your choice using the Google language API. The problem…
Philipp
  • 51
  • 1
5
votes
1 answer

Safari Extension Taking Screenshot

I am developing safari browser extension which should have taking screenshot functionality. Chrome and Firefox has their own apis to take SS of the current window document. I could not find any safari specific/API documentation for it. The Windows…
Teoman shipahi
  • 47,454
  • 15
  • 134
  • 158
5
votes
1 answer

Is there a simple conversion method for converting chrome message passing to the safari message passing syntax?

My Chrome extension uses message passing to retrieve various values from the extension's built in localstorage area on the background page. The thing I love about chrome message passing, is it lets you include a callback function inside the…
user280109
  • 1,476
  • 3
  • 16
  • 27
5
votes
0 answers

Extension creation fails with no information

I have a browser extension that works in Firefox, IE and Chrome and I'm currently porting it to safari. I followed the instructions on the apple developer site and also renamed the extension folder to myext.safariextension . I got a certificate and…
Benjamin Gruenbaum
  • 270,886
  • 87
  • 504
  • 504
5
votes
2 answers

Programmatically change icon of Safari browser extension?

I have a Safari browser extension with a disabled mode. What I'd like to do is to programmatically change the toolbar icon when the user enters disabled mode. Is there an API which will allow me to achieve this and if so what is it?
David Tuite
  • 22,258
  • 25
  • 106
  • 176
5
votes
1 answer

Can I set up my safari extension to be installed when clicked instead of downloaded?

I have written, signed, and built a safari extension (.safariextz file). I have tried adding two mime type handlers to apache: AddType application/x-safari-extension .safariextz and also i have tried AddType application/octet-stream…
cwd
  • 53,018
  • 53
  • 161
  • 198
5
votes
1 answer

Highlight URL bar using Chrome and Safari extension

Is it possible to highlight the URL bar (set focus to the location bar) using Google Chrome extensions or Safari extensions? Using Firefox extensions, one can highlight the URL bar like this: var…
5
votes
1 answer

Close Safari popover using button click within popover

I am working on a Safari extension which displays a popover on clicking the toolbar button. I have added 2 buttons in the popover cancel and save. I want to dismiss the popover on clicking the buttons. How can I do this? I tried using self.close()…
Vivek
  • 680
  • 1
  • 12
  • 24
4
votes
2 answers

Safari extension send message to a specific tab

Is there a way to send a message from the global page to a specific tab? What I'm currently doing is, on tab creation the injected script creates a unique id and sends a message with this number to the global page and the global page saves this…
4
votes
2 answers

Executing host script from an injected page

I'm writing a Safari Extension that adds some functionality to a web page that I don't own. I would like for my injected JavaScript page to be able to fire some JavaScript functions the host page uses, but it doesn't work. On the Console I get the…
Dov
  • 15,530
  • 13
  • 76
  • 177
4
votes
2 answers

Mac App Store app with Safari Extension

I'm trying to understand how an app like 1Password can be on the Mac App Store and come with a Safari extension (and most importantly, how can the extension communicate with the app) because I'd like to do the same. Is the native app running a…
Remy Vanherweghem
  • 3,925
  • 1
  • 32
  • 43
4
votes
0 answers

How to get the state(enabled/disabled) of IOS Safari extension?

This SO is about how to get the state of a macOS safari extension. Wondering how it can be done with IOS ? (In its app container aka via swift) P.S: the mac code won't work on IOS as it gives: Cannot find 'SFSafariExtensionManager' in scope which…
4
votes
1 answer

Safari Web Extension Fails to Send Native Message

I'm trying to create a Safari Web Extension to my native app. I want to have a popup with a button which when clicked will communicate with my native app: browser.runtime.sendNativeMessage({message: "Open Main App"}, function(response) { …
RRN
  • 1,127
  • 1
  • 12
  • 37