Post

Replies

Boosts

Views

Activity

declarativeNetRequest modifyHeaders action.type
Currently Safari does not support modifyHeaders as an action.type when using the declarativeNetRequest API. Does the Safari team plan on building out this action.type for the API? Safari seems to be the only major browser that lacks support for header manipulation, even with the mv2 APIs (ie. webRequestBlocking). Is this purposefully being omitted? If so, why?
1
0
1.1k
Aug ’22
Is webRequest supported?
Adding the webRequest permission to my manifest file does not give me access to the webRequest WebExtension api in my background page. From looking at the docs, I see that webRequestBlocking is not supported, but no mention of webRequest not being supported. I am on macOS 12.1 and Safari 15.2. Example: ... "permissions": [ "<all_urls>", "webRequest" ] ...
1
0
984
Dec ’21
SFErrorDomain Code=3 "(null)"
I am running a Safari extension on my phone and getting this error when running browser.runtime.sendNativeMessage({...}); I am only getting this error when sending a specific message, other messages return as expected. When I run on the simulator I do not get this error. Does anyone one what Code=3 represents?
2
0
1.7k
Oct ’21
HTML Download Attribute using data URI
Clicking an anchor tag <a> using a download attribute and data uri as the href doesn't trigger a download in a webextension bundled html page. Rather it opens a new tab and navigates to the data uri. This is the not the same behaviour users experience on the web nor the same behaviour as a Safari App Extension bundled html page. Is this intentional? Is this a shortcoming of the WebExtension API? Is there any way around this? Any guidance would be appreciated.
1
0
1.5k
Aug ’21
documentUrlPatterns in browser.contextMenus.create not functioning as expected
This also applies to browser.menus.create. Adding a url to documentUrlPatterns that has an explicit pathname, such as /some/page/ does not against document urls that should match. Example 01: browser.contextMenus.create({id: "12354", title: "Test01",documentUrlPatterns:["https://www.linkedin.com/feed/"]}); When using the above code, no context menu item is created for "https://www.linkedin.com/feed/". However, if I drop the trailing slash /, the menu item is created as expected. If the page has no formed pathname, it's simply /, the context menu is created as expected. The following code will work as expected, note the pathname. Example 02: browser.contextMenus.create({id: "12354", title: "Test01",documentUrlPatterns:["https://www.apple.com/"]}); Example 01 works as expected in Firefox, but as mentioned does not work in Safari. Is this purposeful or potentially a bug? Specs: Safari Version 14.1.1 (16611.2.7.1.4) macOS Version 11.4 (20F71)
0
0
1.1k
Jul ’21
Safari App Extension API vs WebExtensions
Is there parity between the two APIs? My extension is using the "original" Safari App Extension API (swift). However, I can do things with WebExtensions I can not seem to accomplish with Safari App Extensions. A simple is example is dynamically creating a context menu item (browser.contextMenus.create({...})). There are likely more examples, but that was the first I tried. Is there some undocumented API for Safari App Extensions that allows for everything that WebExtensions are capable of doing?
2
0
1.5k
Jan ’21
Almost every test build I need to re-allow & enable my extension
Almost every single test build I run with my extension, I need to: open extension preferences click the checkbox for my extension double click my apple watch to approve click 'turn on' button after approved To be clear, I am told my extension interferes with clicking - that is why I need to go through two steps to re-allow the extension and I theorize that is also why my extension becomes disabled after every test run. This isn't ideal since I tend to build/test my extension quite a bit as I am developing. This adds a lot of time to that process. Is there anyway, as the developer, to stop getting these prompts and just keep the extension enabled and allowed during development? Thank you.
3
0
1.1k
Dec ’20
Toolbar Button Icons are Blue
All of my third party extensions have blue icons now, in Safari 14.0. It looks pretty awful. Is there a way to keep the monochrome colors or a way for us, as developers, to provide a different kind of icon to sustain the monochrome colors for our extensions? I am assuming the blue color denotes something, like the extension being "active". I wasn't able to find documentation on this change nor any related api doc.
12
1
5.3k
Sep ’20
What does "active" mean in SFSafariPageProperties
When my extension loops through all open pages and the page properties, all pages isActive prop returns true. For example: 2 Safari windows open Window 1 has 2 tabs open (apple.com, bing.com) Window 2 has 3 tabs open (google.com, github.com, extension's bundled html) I am in Window 2 and on my extension' bundled html page When I run a function that iterates through the pages and returns the isActive prop - all pages return true, except my bundled html page. (I understand my extension's bundled html page won't return page props, this is not my issue) What exactly does isActive indicate? code (perhaps there is a more terse way to write this): SFSafariApplication.getAllWindows { (windows) in         for window in windows {             window.getAllTabs{ (tabs) in                 for tab in tabs {                     tab.getPagesWithCompletionHandler { (pages) in                         if pages != nil {                             for page in pages! {                                 page.getPropertiesWithCompletionHandler({ props in                                     let isActive = props?.isActive ?? false                                     if !isActive {                                         page.getContainingTab(completionHandler: { tab in                                             tab.close()                                         })                                     }                                 })                             }                         }                     }                 }             }         }     }
0
0
740
Aug ’20
SFSafariPageProperties for bundled html pages
Is there any way to determine if a bundled html page is already open within Safari? Iterating through the open tabs and looking at the page properties (url, title, etc...) all return nil for bundled html pages currently open in the browser. When a user clicks the toolbar icon in my extension, I'd like to check if another instance of the extension's bundled html page is already open in a tab, and if so, activate that tab rather than opening another instance.
1
0
811
Jul ’20
Do page CSPs apply to Safari WebExtension content scripts?
Currently, if a page csp disallows inline scripts, but the content script attempts implant inline scripts (DOM injected scripts) - the code will fail to execute. This is an issue with the current Safari extension model. The effect of this is that content scripts that inject dynamic (user-generated) content can not properly interact with the page context. This is also an issue with other major browsers, however I do not believe Chrome has this restriction. The reason I say "do not believe" is because the documentation indicates that "page csp does not apply to content scripts", but I have not personally tested this. I'd like to know is this restriction will be present with the new Safari WebExtension model, especially considering that webRequestBlocking is not supported (which would be the only workaround I am aware of).
6
0
2.7k
Jun ’20
Using Google Analytics w/Safari Extension
I am trying to implement Google Analytics with my extension that is built with the Extension Builder. Is there any guides or advice on how to go about implementing this?My extension consists of a global.html and popover.html file only. I tried putting the GA snippet in both and it is seemingly not working. I can see through the console that when the GA snippet is in the popover.html, a network request is being made to the GA server, but it doesn't seem to be tramistting the data. If I run my extension locally (it's using plain web technologies), I can see on my analytics page that it is registering my activity; this doesn't happen whilst using the extension.Any help or advice would be appreciated.
2
0
3.8k
Dec ’17