Post not yet marked as solved
Xcode 12.4 on Big Sur, a very basic attempt to launch and debug a process.
Little-Net:host-osx minfrin$ lldb ./tmp_firefox/Library/Google/Chrome/NativeMessagingHosts/chrome-token-signing.app/Contents/MacOS/chrome-token-signing
(lldb) target create "./tmp_firefox/Library/Google/Chrome/NativeMessagingHosts/chrome-token-signing.app/Contents/MacOS/chrome-token-signing"
Current executable set to '/Users/minfrin/src/redwax/open-eid/chrome-token-signing-trunk/host-osx/tmp_firefox/Library/Google/Chrome/NativeMessagingHosts/chrome-token-signing.app/Contents/MacOS/chrome-token-signing' (x86_64).
(lldb) process launch -i cert.native
error: process exited with status -1 (attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries when the attached failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.))
Why would lldb, running as my local user, be unable to launch a process also running as my local user?
Is there any way to convince lldb to log error messages instead of referring me to the console, which contains a continuous stream of noise?
Post not yet marked as solved
I have a Safari Web Extension that successfully receives a message from a webpage and returns a response.
I now want to add a user interface to the Safari Web Extension. How do I do this?
I have modified the default template code as follow to add an NSAlert for testing. The modal runs, but no alert ever appears, and the code remains stuck at runModal.
What is the correct way to add a UI to a webextension?
- (void)beginRequestWithExtensionContext:(NSExtensionContext *)context {
id message = [context.inputItems.firstObject userInfo][SFExtensionMessageKey];
NSLog(@"Received message from browser.runtime.sendNativeMessage: %@", message);
NSAlert* alert = [[NSAlert alloc]init];
[alert setMessageText:message[@"request"]];
[alert setInformativeText:@"Hello"];
[alert runModal];
NSExtensionItem *response = [[NSExtensionItem alloc] init];
response.userInfo = @{ SFExtensionMessageKey: @{ @"id": message[@"id"], @"uuid": message[@"uuid"], @"contentType": message[@"contentType"], @"response": message[@"request"] } };
[context completeRequestReturningItems:@[ response ] completionHandler:nil];
}
@end
Post not yet marked as solved
I have a web extension that I want to send data to, and receive a response containing modified data.
My understanding is that the native app is only contactable by a background script. How does a webpage contact the background script?
One answer is by adding a content script, which is able to communicate with the background script using browser.native.sendMessage(). Unfortunately this triggers a warning that "this extension can read and alter web pages".
I do not want to read and alter web pages, nor do I want users to be concerned about a permission the app doesn't need. I just want to receive data, and then return a response.
What API should I be using to achieve this?
Post not yet marked as solved
Under MacOS, the SFCertificateView class will display details of a certificate.
https://developer.apple.com/documentation/securityinterface/sfcertificateview?language=objc
What class will give an equivalent view in iOS?
An example implementation are the certificates listed under profiles in the Settings app.
Post not yet marked as solved
According to https://developer.apple.com/safari/extensions/ I can "Enhance and customize the web browsing experience on Mac, iPhone, and iPad with Safari Extensions".
Sounds great so far.
I am looking for information on how I can can create a Safari Extension on iOS, and I have come up blank.
All the docs make no mention of iOS, just MacOS.
The sample code at https://developer.apple.com/documentation/safariservices/safari_web_extensions/messaging_a_web_extension_s_native_app?language=objc is for MacOS only.
Xcode project templates list "Safari Extension App", but only under MacOS.
I'm lost, are WebExtentions / Safari Extensions supported on iOS, and if so, how?
There are apps in the iPhone App Store that claim to integrate with Safari. What technology are they using?
Post not yet marked as solved
Are there any working examples of XIB files corresponding to the user elements found within the typical parts of MacOS?
There is no shortage of documentation describing user interface theory, I am looking for concrete examples of best practise.
Do these exist?
Post not yet marked as solved
Is the "Add Missing Constraints" function in the Xcode User Interface Builder known to work properly, or should this functionality be avoided?
Conceptually, constraints make perfect sense. Each element is declared as having a behaviour relative to other elements, allowing the layout to be calculated automatically. In my case I have a number of elements, and each element needs to be rendered below the previous one. So far makes sense.
In practice, adding constraints is very hit and miss. No matter how carefully I add the constraints by hand, I get warnings "height is ambiguous" or "vertical position is ambiguous", but none of these messages are ever specific enough to explain what's actually wrong.
Eventually you select the "Add Missing Constraints" option, and at this point chaos is unleashed. Constraints are added between elements that have no obvious relation to one another. The third element down immediately gains a constraint relative to the top of the window, for no obvious reason. Constraints suddenly have constants added, none of which make any sense. Elements are now off the screen, with no obvious explanation.
At this point the constraints are wrecked, and the UI has to be redeveloped from scratch.
My question is this: Is there a specific technique that should be used to handle constraints when building a UI? Is there a special order things should be done in? Should the UI be avoided and all constraints be declared programmatically?
The user interface is supposed to be the Mac's core strength. I can't see how any user interface gets developed with tools this unfinished. Can anyone shed any light of how to approach practical UI design on the Mac?
Post not yet marked as solved
With OpenSSL deprecated on the Mac, I need to replace the EVP_DigestSignUpdate() function in the following code:EVP_DigestSignInit()EVP_DigestSignUpdate()EVP_DigestSignUpdate()EVP_DigestSignUpdate()...EVP_DigestSignFinal()Much googling and manual reading leads me to the SecTransformExecute() function, however it appears (but is never explicitly stated) that SecTransformExecute() can only ever be called once, implying that it is impossible to sign or verify unbounded/streamed data.All of the examples I can find encrypt/sign a contrived single block of plaintext, which is an edge case - in the real world data is unbounded and not all present at once.OpenSSL handles this by allowing the EVP_DigestSignUpdate() function to be called more than once. How does the SecTransform API handle this case? Does anyone have any example code that makes this clear?