My Safari App Extension is having trouble with one website. This is typical for some other websites as well.
Navigating to that website results in 6 “Load” events. For each such event I send a “safari.extension.dispatchMessage” to my objC code.
For the first of these Load messages, my objC code sends a ‘sendMeIcons” message to “safari.self.addEventListener('message', function(event)”. The other 5 Load events are ignored by my objC code and do not send this message.
safari.self.addEventListener('message', function(event) receives sendMeIcons JUST once. Yet, the event handler for this message) is invoked 4 times. The first invocation is correct. The other 3 are spurious.
I have no idea why this is happening.
Here is my objC code
safari.self.addEventListener('message', function(event)
{
if (event.name === "Load My URL")
{
console.log('In event listener Load My URL');
...
return;
}
if (event.name === "sendMeIcons")
{
...
if (hrefs.length <1) //THIS IS ALWAYS TRUE FOR THIS TEST CASE.
{
safari.extension.dispatchMessage("js Found No Icons");
return;
}
else
{
...
safari.extension.dispatchMessage("IconsReturned",{"urls": arrayOfUrls});
return;
}
}
I don't have a clue how to proceed. Any suggestions.
Post
Replies
Boosts
Views
Activity
As far as I can determine, there is no way to save the data in my Safari App Extension when Safari terminates. It seems I have to save the data every time the page changes. That's wasteful. Does anyone know of a work around?
I'm trying to get the row index of a NSTableRowView that has experienced a mouseEnter event. It should be easy with rowAtPoint using NSEvent.locationInWindow. I can't get it to work. The NSTableView lies inside a NSStackView. Of course the NSStackView adjusts the visual size of the NSTableView etc. Is NSStackView interfering? If so, how should I adjust my call to rowAtPoint?
When calling:NSURL* aURL = [NSURL URLByResolvingBookmarkData:secBookmark options:options relativeToURL:nil bookmarkDataIsStale:&isStale error:&err];isStale is YES.When attempting to get a fresh bookmark, calling:NSData* secureBookmark = [aURL bookmarkDataWithOptions:options includingResourceValuesForKeys:nil relativeToURL:nil error:&err];produces:2019-03-11 15:53:51.603133-0700 ***[534:8439] Error: Error Domain=NSCocoaErrorDomain Code=256 "Could not open() the item" UserInfo={NSURL=file:///Users/oldmancoyote1/Desktop/E%20Projects%20folder/Drawing/Drawing%201%20.pdf, NSDebugDescription=Could not open() the item}If I ignore isStale, there appears to be no problem. Can I safely ignore isStale?
I'm building a safari app extension with objective c. I'm using the default Xcode project. I've successfully added a NSView to the popover window. When I drag a NSTableView into the popover window, it appears in the XIB, but I can't find how to connect it to the SafariExtensionViewController. I tried adding a custom ViewController to the XIB and making the tableview its view which seems to be ok. How should I proceed from here, or is their another approach?
Can macOS Safari App Extensions be purged for example in low memory situations?
I'm writing a safari app extension using the default Xcode project and objective c. I want to add interface items to the popover(as Xcode has defined it with the SafariExtensionViewController.xib) and use the SafariExtensionHandler to control and respond to these interface items.
I find that I can add interface items to the SafariExtensionViewController.xib. I also can connect those items to SafariExtensionViewController.h. However, SafariExtensionHandler.popoverViewController is a member of the SFSafariExtensionViewController class, the superClass of SafariExtensionViewController so I can not use this popover controller to access the outlets that I add to the SafariExtensionViewController. How can I access these interface items from the SafariExtensionHandler?
ChatGPT suggest I use [SFSafariApplication sharedApplication] as an intermediary. There is no such thing. Sign!
I just installed the default safari app extension (the one created by Xcode) on my mac. Its icon is visible in Safari, but when I run the extension, nothing happens. Then when using the Safari/Developer/Web Inspector/ and choosing Sources, an Extension Script folder does not appear at the lower left. Do you have any suggestions to resolve this problem?
Just a simple question here:
As far as I can tell, I must install my Safari extension with an app that I built in Xcode.
OK.
What is not clear is what happens when the user quits my installing app. Does the extension remain available through Safari, or is it deleted?
Is it available the next time my user runs Safari, or does he/she have to run my installer app again?
When I shut down the mac while my app is still running, my app relaunches the next time I launch the mac. The problem is the data I had just entered into my app before shutdown is not saved as it is when I Quit the app. I'm trying to better understand this automatic relaunch of open apps so I can address this issue. Where is the documentation? What are the key words?
My mapkit app has to work in areas where there is no cell or internet service. Can mapkit download a local map or satellite image for later use in conjunction with GPS or saved locations?
Using NSDocument.readFromData and NSKeyedUnarchiver.unarchiveObjectWithData, I retrieve an object (of type A) with a property of type NSMutableArray. That array contains a nested chain of objects of type A. The problem object is a child of a child... in that array. I try to do Count on that array and I get an error.
I received a automated phone call claiming to be from a organization managing distribution of the award in the case of Cameron, et al. vs Apple
The address I am supposed to respond to is: HTTPS://samllappdeveloperassistance.com
Is this a scam?
I submitted a version of this question 3 years ago. There has not been an answer. 662 developers are watching that question. As requested by KMT I submitted a bug report. Others had submitted a similar bug report before me.
As far as I can tell, nothing has been done to address this issue.
Not addressing this issue amounts to disturbing negligence. This is important!
WebView is flakey. It needs to be replaced.
Apple Engineering:
Please accept responsibility for this issue and respond with a date when we can expect a solution.
In the past when I entered an object name in the search field at the top of the documentation window, Xcode would display appropriate object names. Now when I enter an object name like NSVIew, 'No Results' is shown. Apparently I am missing some data file. What's going on?