Questions tagged [safari-web-extension]

Apple's implementation, starting with MacOS 11/Safari 14, of the browser extension API already in use by Firefox and Google Chrome

Safari Web Extensions are Apple's implementation of the extension APIs now common among Safari, Firefox, and Google Chrome.

Official Documentation

Safari Web Extensions are distinct from Safari App Extensions, which focus on interoperability of native MacOS and iOS applications and the browser. Safari Extension is a legacy API deprecated with MacOS 10.12.

45 questions
23
votes
6 answers

Convert Google Chrome Extension to Firefox or Safari extension

Is it possible to convert a Google Chrome extension to a Firefox or Safari browser extension?
14
votes
1 answer

How do I read the local storage of my Safari Web Extension using Selenium in Python?

With the Firefox WebDriver I can read the local storage of my extension like so: extension_path = "/path/to/my/extension" info = { "extension_id": f"foobar", "uuid": uuid.uuid4(), } base_url = f"moz-extension://{info['uuid']}/" opts =…
Oskar Persson
  • 6,605
  • 15
  • 63
  • 124
5
votes
0 answers

Safari Web Extension Sign in With Google

Safari now can use web extensions. But browser.identity or chrome.identity is not supported. So launchWebAuthFlow is not working. In the docs they just say. identity Not supported. Initiate an OAuth flow in a new tab. How can I do it? Is there any…
rendom
  • 3,417
  • 6
  • 38
  • 49
4
votes
2 answers

Why does `scripting.executeScript` in Safari return a `null` element array instead of `InjectionResult` element array?

I've recently noticed a strange behaviour in Safari when injecting a content script with scripting.executeScript. The expectation here is that an array of InjectionResult objects will be returned (one for each frame the script was executed in). In…
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
4
votes
1 answer

NSExtensionRequestHandling not handling native messages

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. Before I get to this part I have a problem sending a native message and handling it in…
3
votes
2 answers

Detect when user closes pop up in iOS Safari web extension

I'm trying to find a way to detect when the user closes or dismisses the pop-up in an iOS Safari web extension. I've tried listening for onblur, pagehide, and visibilitychange events but they are not fired when the popup is closed. All of these…
Harrison Friia
  • 372
  • 2
  • 10
3
votes
0 answers

Why does xcrun think Safari doesn't support manifest.json keys?

I am converting a very basic WebExtension to a Safari Extension, and am getting an odd warning when I run the xcrun command. xcrun safari-web-extension-converter Warning: The following keys in your manifest.json are not supported by your current…
3
votes
2 answers

sendMessage not received by options page onMessage in Safari

I have ported a Chrome/FireFox extension. One of the things that does not work is receiving message from background to a options page (safari-web-extension:///page.html) I dont get a error message or any details back from the promise. Any idea where…
2
votes
1 answer

Is there a way to detect if extension is running on iPad vs iPhone

I am porting an extension from Chrome/Firefox to Safari on iOS. When the extension popup comes up there are two different behaviors on Safari on iOS. On iPhone it comes up as a full screenwidth menu from the bottom of the screen. On iPad it behaves…
Namaste
  • 203
  • 1
  • 10
2
votes
1 answer

Send message from app (popup.js) to JS (content.js) in Safari Web Extension (iOS 15)

I'm having trouble with a simple task. In Xcode 13, you can create a Safari Extension App (Safari Web Extension for iOS 15). From looking around, the Shared Extension has various js resources: background.js, content.js, and popup.js. Popup.js is the…
xta
  • 729
  • 2
  • 8
  • 29
2
votes
0 answers

Safari web extension - background script - sessionStorage and localStorage not accessible

I converted an extension from Chrome to Safari using: xcrun safari-web-extension-converter All works except for one thing: when trying to access the localStorage or sessionStorage from background script I get: SecurityError: the operation is…
Nathan B
  • 1,625
  • 1
  • 17
  • 15
2
votes
1 answer

Web Extension (browser plugin) for Chrome, Firefox, Safari standard reference and tools (2021)

As far as I remember correct name for browser plugins we are using today are actually called "Web Extension". Before every browser had its own APIs, then Chrome and Firefox agreed, and now Safari (v14 with macOS 11 in 2021)…
2
votes
0 answers

Safari Web-Extensions - cannot save files using FileSaver.js

Safari stops the download(triggered from my browser extension) as soon as it begins and shows the file name as "unknown". I have figured out that this can also happen to any website if you set the Download permission for that website to Deny in the…
1
2 3