Posts

Post not yet marked as solved
0 Replies
362 Views
When the popover view opens, my extension try to read credentials of the keychain.Then a keychain window opens and ask for a password. Impossible to type into the password field a password. The entered keys are ignored.This is a serious bug in mac os. I sent this even to feedback assistant, but got no response.Feedback ID: FB7665923As workaround, you can copy the password into the clipboard and then doing right mouse click to paste it.
Posted Last updated
.
Post not yet marked as solved
0 Replies
335 Views
I'm trying already for several hours to localize the single menu item in the Info.plist file SFSafariContextMenu -> Item 0 -> Text.I replaced the value of the text by CONTEXT_MENU_ITEM_PASTE_ADDRESS.Then I created a InfoPlist.strings file and localized it in all my supported languages.In each localized InfoPlist.strings file, I added:German:CONTEXT_MENU_ITEM_PASTE_ADDRESS = "Wegwerfbare E-Mail-Adresse einfügen";French:CONTEXT_MENU_ITEM_PASTE_ADDRESS = "Coller une adresse jetable";English:CONTEXT_MENU_ITEM_PASTE_ADDRESS = "Paste disposable address";Then I cleaned the build project directory and compiled again the project and run it.Now Safari is showing in the context menu "CONTEXT_MENU_ITEM_PASTE_ADDRESS" without showiung the real localized value of it.Is this a bug in the Apple framework?
Posted Last updated
.
Post marked as solved
2 Replies
5.1k Views
I'm trying to do a simple POST request in Swift in my Safari Extension, but there is no way that it works.Example code:let url = URL(string: "https://136.243.65.157") let task = URLSession.shared.dataTask(with: url! as URL) { data, response, error in guard let data = data, error == nil else { return } print(NSString(data: data, encoding: String.Encoding.utf8.rawValue)) } task.resume()I get:2019-10-19 22:03:14.430621+0200 TrashMail.com Extension[16213:361162] [] nw_socket_connect [C2:3] connectx(12 (guarded), [srcif=0, srcaddr=, dstaddr=136.243.65.157:443], SAE_ASSOCID_ANY, 0, NULL, 0, NULL, SAE_CONNID_ANY) failed: [1: Operation not permitted] 2019-10-19 22:03:14.430772+0200 TrashMail.com Extension[16213:361162] [] nw_socket_connect [C2:3] connectx failed (fd 12) [1: Operation not permitted] 2019-10-19 22:03:14.430851+0200 TrashMail.com Extension[16213:361162] [] nw_socket_connect connectx failed [1: Operation not permitted] 2019-10-19 22:03:14.431318+0200 TrashMail.com Extension[16213:361162] Connection 2: received failure notification 2019-10-19 22:03:14.431363+0200 TrashMail.com Extension[16213:361162] Connection 2: failed to connect 1:1, reason -1 2019-10-19 22:03:14.431388+0200 TrashMail.com Extension[16213:361162] Connection 2: encountered error(1:1) 2019-10-19 22:03:14.432825+0200 TrashMail.com Extension[16213:361162] Task <34726962-7BF0-4ED5-8DD2-32E4A4DDD1B3>.<2> HTTP load failed, 0/0 bytes (error code: 1 [1:1]) 2019-10-19 22:03:14.433103+0200 TrashMail.com Extension[16213:361213] Task <34726962-7BF0-4ED5-8DD2-32E4A4DDD1B3>.<2> finished with error [1] Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" UserInfo={_kCFStreamErrorCodeKey=1, _kCFStreamErrorDomainKey=1}Is it possible that I have to do this in JavaScript instead Swift4?
Posted Last updated
.
Post not yet marked as solved
1 Replies
567 Views
I would like to show an AppKit popover beside a HTML input field, exactly in the same way as the "New password" generator from operating system does it.Is this possible? For the moment, the possibilities of using AppKit elements in Safari Extensions are very limited.Specially now we need to support Dark Mode etc... it makes no more sense to simulate "AppKit" elements made by self in HTML5.
Posted Last updated
.
Post not yet marked as solved
1 Replies
703 Views
I'm currently porting my TrashMail.com Extension from Google Chrome again to Safari Extensions.However I would like to use native UI Cocoa components instead of "cloning" UI elements in HTML.I'm creating a extension to provide disposable email address. If someone clicks in the context menu "Paste disposable email address", then it should create a window, asking for some parameters and then paste it into the form field.We created this for Google Chrome, this is how it looks:Context menu:And then it should create a window:However: What is bad, the window and the content is pure HTML5 code with CSS styles, that it looks like a native operating system UI element.So instead doing this in HTML5 I would like to do it with a normal XIB file and writing Swift native code that the user have the best user experience. There should be no HTML5 code for the addon. I want that it looks and feel perfectly as the operating system macOS.Is this possible?When I try to start a simple NSAlert dialog, I get already the following error message:"no service marshals available for modal session"I created a feedback ID for this: FB7348486"Simple UI functionality broken or disabled in Safari Extension"I know that Firefox had in the past a similar functionality with XUL, it was very great for the user experience, it displayed the native operating system widgets. Unfortunately they removed it.
Posted Last updated
.