My understanding is that the iOS service worker does not support background sync or a periodic sync. ( if this is not true please point me to the documentation that describes the support of these features... )
High level use case.
My users of my app will be filling out forms during the day while off line ( out of cell phone coverage )... then at the end of the day they will travel back into coverage at which point the WEB app would automatically send those POSTS without User interaction. How would you accomplish this on an iOS device... ( key is without having to relaunch the app )
thank you
General
RSS for tagExplore the integration of web technologies within your app. Discuss building web-based apps, leveraging Safari functionalities, and integrating with web services.
Post
Replies
Boosts
Views
Activity
Is it possible to get 240Hz Apple Pencil events in Javascript? I know that with UIKit you have to poke at coalesced events to get this sort of sampling frequency, but it appears that Safari (and Mobile Safari) do not support the new PointerEvents.getCoalescedEvents() API (https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/getCoalescedEvents).
Anyone know of another way to get high-frequency 240Hz Apple Pencil events (e.g. as touchmove or pointermove events)?
I am trying to implement Quick Notes through SwiftUI, rather than UIKit or AppKit. I am unsure if the behaviour below is expected, or due to a bug.
I have already successfully implemented NSUserActivity for Handoff, Spotlight and Siri Reminders, using the .userActivity() view modifier. These NSUserActivity instances use the NSUserActivity.userInfo dictionary to store and correctly restore the content through the .onContinueUserActivity(perform: ) methods.
Quick Notes requires using the .persistentIdentifier or .targetContentIdentifier properties, rather than the .userInfo dictionary alone. However, when I set these either of these to unique identifiers using the code below, they are not correctly stored within the useractivity.
MyView()
.userActivity(ActivityString, updateUserActivity)
private func updateUserActivity(_ activity: NSUserActivity) {
activity.isEligibleForSearch = true
activity.isEligibleForHandoff = true
activity.title = "Title"
activity.targetContentIdentifier = myItemUniqueID
activity.persistentIdentifier = myItemUniqueID
activity.userInfo = ["id": myItemUniqueID]
print(activity.targetContentIdentifier) // Correctly prints
print(activity.persistentIdentifier) // Correctly prints
print(activity.userInfo) // Correctly prints
}
The identifiers print correctly when setting the user activity above. However, when restoring the user activity (tested through Handoff and Spotlight Search), the targetContentIdentifier and persistentIdentifier strings are empty.
MyView()
.onContinueUserActivity(ActivityString, perform: continueUserActivity)
private func continueUserActivity(_ activity: NSUserActivity) {
print(activity.persistentIdentifier) // Nil
print(activity.targetContentIdentifier) // Nil
print(activity.userInfo) // Correctly prints
}
Is there something else I must do, or is this unexpected behaviour?
I continually receive this error when using AdMob Banners
(swift 5, on iOS simulator and devices using Xcode 13.5)
it seems something related to Webkit, this continuous exception slows my app and continually produce network calls
[ProcessSuspension] 0x10c240f60 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Background Assertion' for process with PID=94309, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
Hello
I have a webrtc-based web app that is loaded inside a WKWebView.
The web app gets loaded just fine in our iOS App running WKWebView on an iPad with iOS 15.1.
We are using the exact same app, built for Mac Catalyst. However, on the Mac version, the web app gets loaded but the RTCPeerConnection object is undefined.. Meaning that our web app assumes that WebRTC is not available in that browser.
Isn't the native app supposed to work the exact same on iOS and MacOS? Is the Mac version of WKWebView more limited than its iOS counterpart ?
Is there any resource that states exactly what is supported in WKWebview in each platform?
Thanks
Hi there - I am trying to port over Chrome extension over to Safari Web extension. Looks like Safari has a very aggressive permissions flow which isn't a great user experience but I get the privacy benefits.
I am trying to move some of my permissions like <all_urls> or tabs as optional permissions and build a flow where I can request the user for them in hopes that i can educate them as to why I need them similar to how Chrome/FF have it.
However when i use browser.permissions.request - i always end up getting true without invoking the prompt. The prompt seems to come up regardless when i start visiting a website.
Can someone help with this? Sounds more like a defect in Safari.
Hello, I would like to track the amount of downloads, on Apple Store, of users coming from the Safari Smart Banner. The smart banner is displayed but we don't have any data in Apple Store. How can I track these downloads? We have a campaign link and I've tried three different ways and it didn't work. Thanks.
I've tried:
<meta name="apple-itunes-app" content="app-id=605512447, affiliate-data=pt=2000418&ct=iOS%20Smart%20Banner&mt=8”/>
<meta name="apple-itunes-app" content="app-id=605512447, affiliate-data=pt=2000418&ct=iOS%20Smart%20Banner”/>
<meta name="apple-itunes-app" content="app-id=605512447, affiliate-data=ct=iOS%20Smart%20Banner”/>
After iOS15.4 was released, we noticed the issue. It seems a system bug. It's waiting for the lock for a long time(dead lock).
Hardware Model: iPhone13,3
Process: app [9492]
Path: /private/var/containers/Bundle/Application/***/app.app/app
Identifier: com.aaa.app
AppStoreTools: 13C90b
AppVariant: 1:iPhone13,3:15
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.aaa.app [956]
Date/Time: 2022-03-17 18:04:46.2811 +0800
Launch Time: 2022-03-17 17:35:18.7389 +0800
OS Version: iPhone OS 15.4 (19E241)
Release Type: User
Baseband Version: 2.53.01
Report Version: 104
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: FRONTBOARD 2343432205
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-update watchdog transgression: application<com.aaa.app>:9492 exhausted real (wall clock) time allowance of 10.00 seconds
ProcessVisibility: Background
ProcessState: Running
WatchdogEvent: scene-update
WatchdogVisibility: Background
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 20.970 (user 13.070, system 7.900), 35% CPU",
"Elapsed application CPU time (seconds): 0.829, 1% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>
Triggered by Thread: 0
Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001cddd1178 __ulock_wait + 8
1 libsystem_platform.dylib 0x0000000207a399ac _os_unfair_lock_lock_slow + 172 (lock.c:578)
2 JavaScriptCore 0x00000001a26f1c38 pas_page_sharing_pool_take_least_recently_used + 800 (lock_private.h:684)
3 JavaScriptCore 0x00000001a26f2cf4 pas_physical_page_sharing_pool_take + 248 (pas_page_sharing_pool.c:716)
4 JavaScriptCore 0x00000001a26ca2ec bmalloc_medium_bitfit_page_config_specialized_allocator_try_allocate + 260 (pas_page_sharing_pool.c:862)
5 JavaScriptCore 0x00000001a26cf48c bmalloc_heap_config_specialized_local_allocator_try_allocate_slow + 328 (pas_local_allocator_inlines.h:1595)
6 JavaScriptCore 0x00000001a26ba39c bmalloc_allocate_impl_casual_case + 888 (pas_local_allocator_inlines.h:1796)
7 JavaScriptCore 0x00000001a19d6fb8 ***::RobinHoodHashTable<***::RefPtr<***::UniquedStringImpl, ***::RawPtrTraits<***::UniquedStringImpl>, ***::DefaultRefDerefTraits<***::UniquedStringImpl> >, ***::KeyValuePair<***::RefPtr<***::Uniqu... + 52 (FastMalloc.h:219)
8 JavaScriptCore 0x00000001a19c6a2c ***::HashTableAddResult<***::HashTableIterator<***::RobinHoodHashTable<***::RefPtr<***::UniquedStringImpl, ***::RawPtrTraits<***::UniquedStringImpl>, ***::DefaultRefDerefTraits<***::UniquedStringIm... + 140 (RobinHoodHashTable.h:729)
9 JavaScriptCore 0x00000001a19c3dac JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry(JSC::VM&) + 33204 (BytecodeIntrinsicRegistry.cpp:59)
10 JavaScriptCore 0x00000001a23931fc JSC::VM::VM(JSC::VM::VMType, JSC::HeapType, ***::RunLoop*, bool*) + 11444 (unique_ptr.h:728)
11 JavaScriptCore 0x00000001a2395fd8 JSC::VM::createContextGroup(JSC::HeapType) + 52 (VM.cpp:241)
12 JavaScriptCore 0x00000001a1811dc0 JSContextGroupCreate + 32 (JSContextRef.cpp:70)
13 JavaScriptCore 0x00000001a14aa2a4 -[JSVirtualMachine init] + 24 (JSVirtualMachine.mm:94)
14 JavaScriptCore 0x00000001a14aa304 -[JSContext init] + 32 (JSContext.mm:71)
15 WebKit 0x00000001a5058b94 API::SharedJSContext::ensureContext() + 56 (APISerializedScriptValueCocoa.mm:51)
16 WebKit 0x00000001a5058ad4 API::SerializedScriptValue::deserialize(WebCore::SerializedScriptValue&, OpaqueJSValue const**) + 44 (APISerializedScriptValueCocoa.mm:78)
17 WebKit 0x00000001a50d7180 ScriptMessageHandlerDelegate::didPostMessage(WebKit::WebPageProxy&, WebKit::FrameInfoData&&, API::ContentWorld&, WebCore::SerializedScriptValue&) + 136 (WKUserContentController.mm:152)
18 WebKit 0x00000001a5424da4 WebKit::WebUserContentControllerProxy::didPostMessage(***::ObjectIdentifier<WebKit::WebPageProxyIdentifierType>, WebKit::FrameInfoData&&, unsigned long long, ***::Span<unsigned char const, 18446744... + 732 (WebUserContentControllerProxy.cpp:346)
19 WebKit 0x00000001a5708dcc WebKit::WebUserContentControllerProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 2716 (HandleMessage.h:139)
20 WebKit 0x00000001a5159b60 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 264 (MessageReceiverMap.cpp:129)
21 WebKit 0x00000001a5381dac WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 40 (AuxiliaryProcessProxy.cpp:247)
22 WebKit 0x00000001a514e2ac IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 788 (Connection.cpp:1080)
23 WebKit 0x00000001a514d960 IPC::Connection::dispatchIncomingMessages() + 508 (Connection.cpp:1229)
24 JavaScriptCore 0x00000001a265de10 ***::RunLoop::performWork() + 200 (Function.h:82)
25 JavaScriptCore 0x00000001a265ebac ***::RunLoop::performWork(void*) + 36 (RunLoopCF.cpp:46)
26 CoreFoundation 0x000000019632ff04 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1972)
27 CoreFoundation 0x0000000196340c90 __CFRunLoopDoSource0 + 208 (CFRunLoop.c:2016)
28 CoreFoundation 0x000000019627a184 __CFRunLoopDoSources0 + 268 (CFRunLoop.c:2053)
29 CoreFoundation 0x000000019627fb4c __CFRunLoopRun + 828 (CFRunLoop.c:2951)
30 CoreFoundation 0x00000001962936b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
31 GraphicsServices 0x00000001b232d374 GSEventRunModal + 164 (GSEvent.c:2200)
32 UIKitCore 0x0000000198bf8e88 -[UIApplication _run] + 1100 (UIApplication.m:3511)
33 UIKitCore 0x000000019897a5ec UIApplicationMain + 364 (UIApplication.m:5064)
34 app 0x0000000104cd277c main + 388 (main.mm:38)
35 dyld 0x0000000109919ce4 start + 520 (dyldMain.cpp:879)
I would like to create a web app where you can drag and drop emails from Apple Mail (on macOS).
When you drag emails to the desktop an .eml file is created, but when you drag emails to the browser no file is being transferred, I can only get the mail’s subject.
So is it possible to drag and drop emails from Apple Mail to browsers? And if yes, then how? So far I've tried chrome and safari, but neither got any files with the dragged element. On windows with outlook or thunderbird this wasn’t an issue, so I hope it can be done with apple mail as well.
Thanks in advance
Hi,
According to Blocking Content with Your Safari Web Extension, we can now use the Declarative Net Request API to block content in a Safari Web Extension.
However, not everything in the API has been implemented just yet.
The supported RuleCondition are domainType, excludedResourceTypes, isUrlFilterCaseSensitive, regexFilter, and resourceTypes.
Does anyone know when the initiatorDomains rule condition will be supported?
In the meantime, is there a way for an extension to block requests based on an originator domain?
Thanks
Whenever I'm on this site on Safari and I log in, after a little while pages will load very very slow or not at all and reeplies to posts will fail over and over. In general this website becomes unusable under safari and upon restarting (i can't just log out because that won't work either) Safari, everything works again.
This affects the documentation pages too, not just the forums. So I'll quit, log in, try to put in my post as fast as possible before I can't anymore.
I usually copy and paste my post before hitting submit incase my time has ran out.
Seeing an issue where document.cookie is returning an expired cookie. This cookie is correctly not sent in requests and is not displayed in the web inspector (Storage -> Cookies). Problem persists until safari is restarted.
Affects the following user agents...
Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Safari/604.1
Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1
Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Flipboard/4.2.140
Mozilla/5.0 (iPad; CPU OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15
Mozilla/5.0 (iPhone; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1
Mozilla/5.0 (iPhone; CPU iPhone OS 14_8_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1
Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Safari/604.1 [Pinterest/iOS]
Mozilla/5.0 (iPhone; CPU iPhone OS 14_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1
Mozilla/5.0 (iPhone; CPU iPhone OS 15_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/19D52 [FBAN/FBIOS;FBDV/iPhone11,8;FBMD/iPhone;FBSN/iOS;FBSV/15.3.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5]
Was not able to reproduce on Safari 15.0 on OSX 10.15.7. Does not occur in desktop chrome or firefox. Seems OSX and IOS specific.
Edit: the more I look at this it appears to be a webkit bug.
According to the release notes of STP, OffscreenCanvas has been implemented for a while. However, when I run JavaScript code, it fails because OffscreenCanvas is not a recognized command. I feel I’m missing something obvious here. Any help?
I have updated my web extension to use Manifest v3.
While trying to test, I get the error:
_The service_worker script failed to load due to an error.
_
I do not see details on the error, or a place where to find details. Any suggestions?
I'm not sure what is special about Gmail, but my declarativeNetRequest rules are totally ignored.
I make an web extension that blocks email trackers (1x1 pixel images embedded in emails to track if and when you open email sent to you). All images in Gmail are loaded through Google's proxy: googleusercontent.com/proxy/#originalURL
But no matter what I do, I can't block a single image that is loaded in an email. To try and prove it is a bug in Safari, I created a new template web extension in Xcode.
I block all resourceTypes (images and other should be all that is needed) and added two rules:
Block all images loaded through Google's proxy server (this should block all embedded images in all emails)
Block any image with copper in the URL (just in case the blocking doesn't apply to the proxy root url for some reason).
{
"id": 1,
"priority": 1,
"action": { "type": "block" },
"isUrlFilterCaseSensitive": false,
"condition": {
"regexFilter": "googleusercontent.com/proxy",
"resourceTypes": [
"image",
"media",
"main_frame",
"sub_frame",
"stylesheet",
"script",
"font",
"xmlhttprequest",
"ping",
"websocket",
"other"
]
}
},
{
"id": 2,
"priority": 1,
"action": { "type": "block" },
"isUrlFilterCaseSensitive": false,
"condition": {
"regexFilter": "copper",
"resourceTypes": [
"image",
"media",
"main_frame",
"sub_frame",
"stylesheet",
"script",
"font",
"xmlhttprequest",
"ping",
"websocket",
"other"
]
}
}
]
Even though I know this isn't needed, I also added the requester domain (mail.google.com) and the proxy domain (googleusercontent.com) to the permissions list in the manifest file:
...
"declarative_net_request": {
"rule_resources": [{
"id": "ruleset_1",
"enabled": true,
"path": "rules.json"
}]
},
"permissions": [
"declarativeNetRequest",
"*://mail.google.com/*",
"*://*.googleusercontent.com/proxy/*"
]
If I open an email from copper, the image still loads in Gmail
If I right click and select "Open Image in New Tab", the image will not load and I am told it was blocked
If I open a test page that has two images in it, one the image from the email, the image is blocked and the other image is not (as expected, the second image is from wikipedia and should not be blocked)
Running the same extension in Chrome DOES block the image in Gmail (and in all the other cases too)
My goal is to get the push notifications while
I get the following error
The following Swift pods cannot yet be integrated as static libraries
when I run pod install . I have tried the foolowing methods.
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
I also tried with
use_modular_headers!
But it didn't work out.
Could some one say a solution to this issue?
I have a function where user can open webpage in inappbrowser and make payment there. I get this error as below when user want to make payment. My apps have no issue when launch webpage, but when user click to pay and payment gateway call selected bank url, inappbrowser suddenly closed. android is working fine but having problem only in ios. I already update webview to latest version and enable ATS.. but didnt working at all. this is a critical bugs since my users unable to make payments for now. Please help me. thank you
Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Background Assertion' for process with PID=5315, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=5315, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
I'm getting the following error when I try to import my service worker script:
[Error] Failed to load resource: unsupported URL (background_ah.worker.js, line 0)
[Error] NetworkError: Load failed
Using the following code:
try {
self.importScripts('./background_ah.worker.js');
} catch (e) {
console.error(e);
}
Am I doing something wrong? The file is there but from the error it seems the extension protocol is not supported at all.
It works in Chrome and it's based on this:
https://stackoverflow.com/questions/66406672/chrome-extension-mv3-modularize-service-worker-js-file
I have an iOS native app. I have added WKWebView to view controller to show html content.
class MyHTML1ViewController: UIViewController {
private var webView: WKWebView!
var htmlFile: String = "" // default value, can be changed
override func viewDidLoad() {
super.viewDidLoad()
let url = Bundle.main.url(
forResource: htmlFile,
withExtension: "html")
let request = URLRequest(url: url)
webViewBase.load(request)
}
...
}
I run the app on my iPhone through Xcode. It displays html content fine. However, on closing the view, I saw the following error messages in console:
ProcessAssertion: Failed to acquire RBS assertion 'WebProcess
Suspended Assertion'
for process with PID=91330, error: Error Domain=RBSServiceErrorDomain Code=1
"target is not running or doesn't have entitlement
com.apple.runningboard.assertions.webkit"
UserInfo={NSLocalizedFailureReason=target is not running
or doesn't have entitlement
com.apple.runningboard.assertions.webkit}>
Should I add webkit entitlement? how can I do it in Xcode? I prefer to get rid of this error message if they are just warning in console, does not causing app crash.
My Xcode is Version 13.4.1.
When a WKWebView implements the WKNavigationDelegate protocol, clicking a link inside the webview gives back WKNavigationTypeLinkActivated as WKNavigationType in the decidePolicyForNavigationAction.
But clicking on a link inside an iframe gives back WKNavigationTypeOther, which makes it impossible to know if the url is requested on load or on click.
Context:
When a webview loads html (and embedded css, js, iframes, or XHR calls from JS ...), decidePolicyForNavigationAction gives back WKNavigationTypeOther as actionType , so I know content is loading and should be rendered in the webview. When a link is clicked, it gives back WKNavigationTypeLinkActivated so I know I need to show an in-app browser to show the content. This isn't the case with links clicked within an iframe (an <a> tag with href attribute); they return WKNavigationTypeOther