iOS16 and iOS17 were fine, but on iOS18, our Safari extension that blocks content via static rulesets randomly stops working. Frequently, when a tab is left in the background for a long time (i.e. hours), the content blocker will stop working (until I either kill safari, or reload the extension). I've debugged this and the background.js script reports the ruleset as being loaded, but nevertheless, our rules aren't applied.
I really don't think that it's an issue with the way that the rules are defined, since iOS16 and iOS17 worked fine, and on iOS18, the rules DO work. They just stop working after a while.
"declarative_net_request": {
"rule_resources": [
{
"id": "ruleset_1",
"enabled": true,
"path": "ruleset_1.json"
}
]
},
Some theories:
I have other content blockers on my phone that have LOTS of rules (adguard). Could I be seeing the effects of too many rules? Can I debug this somehow? Do logs get printed somewhere when the max rule limit is reached?
Does the use of private and regular tabs mess things up?
Please, any input is appreciated, as all of our logs are normal and error-free.
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
My Safari Web Extension got rejected with the following reason:
"Guideline 4.0 - Design
The user is taken to a new Safari window or tab to sign in or register for an account, which provides a poor user experience."
Is this right?
First of all Design guide line 4.0 does not seem to mention antyhing about this topic.
Second, I've seen many, many web extensions that opens a new tab to let you sign in or register. Including top recommended ones like Grammarly, PayPal Honey and Pocket.
The review also mentions:
It is acceptable to take users to the default web browser for some sign in or account registration options if ASWebAuthenticationSession is used for the session.
That does not seem right either, since that is primarily designed for native apps. I'm pretty sure the extensions I've tried that open a tab for authentication does not use that.
It is like my Safari Web Extension is being reviewed like a Mac OS app. What am I'm doing wrong?
After upgrading to Safari version 18, we encountered an issue with my extension’s background script not being able to access cookies. Previously, in Safari versions 17 and below, the extension worked as expected. Now, when the extension tries to retrieve cookies using browser.cookies.getAll(), it returns an empty list. However, if we open the extension’s developer tools, the cookies are visible and accessible.
It seems that Safari only provides cookie data after the developer tools have been opened. However, after relaunching Safari and launching the extension without opening the developer tools, browser.cookies.getAll() still returns an empty list.
Has anyone else experienced this?
STEPS TO REPRODUCE
Download this minimal app : https://www.icloud.com/iclouddrive/0bajlhnuQaG6T5NsFKXEB0U9Q#test%5Fcookies
Compile test_mv2 extension (in test_cookies.getAll.zip).
Launch test_mv2.app and activate extension.
Click on the extension's button (browserAction).
Open the developer tools.
Observe an empty list of cookies.
Click on the extension's button (browserAction).
Cookies are retrieved as expected.
I'm working on a rather complex web application that includes 3D terrain, 2D mapping, and SVG animations. Both Safari and the Swift app I've built using WkWebKit reload the page after some period of time. Safari pops up a small text block that says:
This webpage was reloaded because it was using significant memory.
Yes. That's true. It's also true that the M1 Max Mac was in now way experiencing issues, nor were any of the other web pages running in other tabs or windows.
The memory limit is simply too low for modern web apps. So far I've not found any way to adjust the parameters in Safari or WkWebView.
Apple, help a brother out. It's not 1997 anymore. Web apps are big. And resetting them at some arbitrary point causes more problems that is solves.
Anyone have any suggestions? Quinn, any way (other than casting a stone into the one-way abyss of Radar) of getting help from the big A here?
Hello, notificationclick event cannnot be triggered if the progressive web app(pwa) is already opened.
I have tried many methods including
client.focus()
clients.openWindow()
client.postMessage() message event listening
Delayed message queue (to let the client being opened)
preventDefault() in notificationclick event
Activation
event.waitUntil()
The situation is that when the device install the pwa twice, the second pwa works normally. However, it is nonsense to ask users install the pwa twice.
Is it a bug in Webkit and will it be fixed in the future? is there a workable example?
Background: using web-push, iOS 17/18
Thanks a lot
HI,
I'm seeking help on the following:
When members of public in Singapore are using iOS 14 and above version to surf gov't websites using Safari, noted that Safari is sending Type 65 DNS queries which had also rendered gov't websites slower as compared to similar chromium browsers. Is there any other workarounds that we can advise the public to adopt?
This is my first time to post on this forum. If there are something we didn't notice, please tell me. Thanks.
Background
We're using canvas to provide a web component to marketing.
https://demo.mescius.jp/spreadjs/BenchmarkSample/
Problem
Recently we have met an issue from customer. He is using iPad 10th to access the web component but when he tries to scroll it and it's very slow on iPad 10th. His iPad OS version is 17.7 and this issue also can be reproduced on our iPad 10th with iPad OS 18.0.1. But if we use iPad 9th with iPad OS 17.7 and 18.0.1, things are fine and there isn't any performance issue.
We developer took some time investigating and found it's because of iPad 10th's safari takes longer time to paint each frame. On iPad 9th, it needs nearly 10ms to paint each frame. But on iPad 10, it needs nearly 70ms to paint each frame.
Also we can provide simple code for you to check the different. We tried to simulate the repaint when user is scrolling. You can see on iPad 9th, it will be 2~3ms but on iPad 10th, it will be more than 10ms for each frame.
test-ipad10.html
It has been happening on iPad 10th only with iPad OS 17.6/17.7/18.0. This will be a big problem for us because it means on the iPad 10th (the latest iPad, non Pro or Air), it can't be used.
Question
Is there anyone knowing similar issue with this one? And do you know how to solve it on iPad 10?
I am running a web server on a Windows machine on my home network to host Automatic1111 (a Stable Diffusion frontend). I was able to connect to it just fine from my MacBook up until I updated to Sequoia 15.2 developer beta.
When I try loading the page, I get ERR_ADDRESS_UNREACHABLE. It is using a non-standard port (7860), so the address is in the form http://192.168.0.xx:7860
I am able to connect just fine from any other device in my house, including Vision Pro. I have checked the solutions suggested in other threads:
Disabling firewall
Disabling IP tracking
Disabling Private IP
Adding Edge to the list of apps allowed to use the local network (Safari doesn't show up in the list)
Clearing the network settings
Restarting multiple times
This seems like a bug and is a huge frustration and blocker for my workflow. :/. Has anyone else encountered this issue and found a way around it?
We have an iOS app (which runs on macOS via "Designed for iPad") which renders web content on WKWebView. Our users can select text (standard OS way of click & drag cursor across text) and then perform actions on those discrete pieces of text.
On macOS 15.1, our users can only expand a text selection, they cannot contract the text selection by dragging the cursor to the left. This reduces the usability of our app on macOS 15.1. This is not an issue on macOS 14.
Environment: MacBook Pro (2021 16” M1 Max), macOS 15.1
Submitted Feedback FB15726254.
I need to capture the HTTP logs triggered from Websheets on iPad to troubleshoot some production issues, I tried with USB option/Xcode but it is not capturing the HTTP logs. Enabled the developer Mode on ipad and the device is connecting to Mac. Appreciate immediate help on this.
What are the conditions under which Safari will clear local storage -- other than script executing localStorage.clear()?
Hi,
iOS 18.1 Safari 18 does not play HLS/.m3u8 audio tracks (while all previous iOS Safari still do).
If I turn on the Web Inspector toggle and put it on, restart Safari/ refresh the page, the player works.
Before filing a bug, are you already aware of such behavior or some way to deal with it?
I'm experiencing a persistent issue with transparent WebM videos rendered via WKWebView in an iOS Capacitor app. The videos play normal, however, they display a black background frame, which does not occur in the web version of the app. I've tried:
Playing with the css setting,
Enabling experimental WKWebView features,
Adjusting meta tags for inline video playback and hardware acceleration.
That my code:
showThumbs={false}
showStatus={false}
showIndicators={true}
showArrows={false}
infiniteLoop={true}
autoPlay={true}
interval={5000} // Change slide every 5 seconds
onChange={(index) => {
if (playerRefs.current[index]) {
playerRefs.current[index]?.seekTo(0);
playerRefs.current[index]?.getInternalPlayer()?.play();
}
}}
>
{videos.map((video, index) => (
<div key={index} className="video-slide">
<ReactPlayer
ref={(player) => (playerRefs.current[index] = player)}
url={video.src}
playing={isLoaded[index]} // Play only when video is loaded
loop
muted
width="100%"
onReady={() => handleVideoReady(index)} // Set loaded state when video is ready
style={{ backgroundColor: 'transparent' }}
config={{
file: {
attributes: {
playsInline: true,
},
},
}}
/>
<p className="description">{video.description}</p>
</div>
))}
</Carousel>
Working with React, capacitor.
The videos work perfect when I test it on the web app, the problem occurs just on my ios app
I'm porting a web extension from Chrome to Safari, and I need to execute a method as a content script that is part of an ES module (in particular its default export).
In Chrome I use following snippet (via Stack Overflow)
const results = await chrome.scripting.executeScript({
args: ["/js/content_script/main.js"],
func: async (path) => {
const src = chrome.runtime.getURL(path);
const { default: asyncMain } = await import(src);
return asyncMain();
}
});
In Safari this seems to either not work, cause the Web Extension Background Context window to close, or crash the browser.
Am I doing something wrong, or is this not possible?
The strange_behaviour.mp4 video attached shows how when running a list of statements to open (startCamera) and close (closeCamera) the camera against a MacBook Pro 2019 using the FaceTime camera, these return their value almost immediately, when in reality the camera is still opening and closing.
We believe that there might be a queue for statements to run against the camera and it finishes the awaits when all the statements are inserted in the queue instead of when they are actually solved.
We also attached the expected_behaviour.mp4 video where we replicate the same flow but using an external camera instead of the FaceTime camera. In this video, the promises take a bit longer to return but they do once the camera has already been opened and closed the requested amount of times.
The project used in the videos is attached as project.tar.xz.
We would like to know if the behaviour in strange_behaviour.mp4 is replicable on your side and if there is a way to access the cameras to make it behave like when using an external camera (expected_behaviour.mp4).
Attachments: https://drive.google.com/drive/folders/1cOeFb5GMbh4mPOeZiZyyevk3N778Kn1M?usp=sharing
Starting Safari 18, Declarative Net Request redirections are no longer working (it used to be working on Safari 17). It seems to be related to the regex validation that is not working as expected.
Here is an example of our DNR rule:
{
priority: 1,
action: {
type: 'redirect',
redirect: {
regexSubstitution: `${scheme}//${extensionHost}/index.html\\1#/\\2`,
},
},
condition: {
// app.dashlane.com, *.app.dashlane.com
regexFilter: '^https?://w*\\.?app\\.dashlane\\.com(\\??[^/#]*)[^#]*#?/?(.*)$',
resourceTypes: [
'main_frame'
],
},
}
Is it a known issue ?
Also, it seems to be related to this existing issue:
https://forums.developer.apple.com/forums/thread/763505
Any ideas why safaridriver is asking for "password to make changes" when launching?
This only started after upgrading to Sequoia 15.1 and Safari 18, was working fine before that.
I am admin on the machine.
JavascriptCore doesn't come with any support for setTimeout (which is an API on the window/DOM object not provide din JavaScriptCore). So you need to implement a version of this yourself - no worries on that (there are examples to refer to out there, so it is fairly easy to set this up).
But I have come across an issue with this that I am not sure how to handle properly. It relates to when the timer callback fires and runs code in the JavaScript engine itself.
Consider this code snippet (assume I have provided an implementation of setTimeout):
console.log('Hello - here we go');
setTimeout(() => {
console.log('Hi from setTimeout callback ...');
}, 0);
Promise.resolve().then(() => {
console.log('Hi from promise');
});
console.log('Hi from main block');
In Node.js or say Safari, I would see this output:
Hello - here we go
Hi from main block
Hi from promise
Hi from setTimeout callback ...
So the promise then() is handled before the settimeout callback is handled. I think this is basically because Promise then() handlers are pushed onto something like a microtask queue, and the setttimeout callbacks on a separate queue, and the microtask queue is emptied before any other queue is processed (after completing the current event loop of course).
But when I implement this in JavaScript core, I don't always see the above - instead I can have:
Hello - here we go
Hi from main block
Hi from setTimeout callback ...
Hi from promise
So the timeout callback can be run BEFORE the promise handler. This obviously is different from Node or Safari.
Now I assume that is because the timeout callback is triggered from Swift native code that uses the call() API on a JSValue object that is provided when the settimeout is given to the native layer to process. And it seems that when native code attempts to execute JavaScript code (via call() or similar) then this is just executed as soon as possible - obviously not interrupting the Javascript core when executing any current event loop code, but potentially running between the point when the Javascript core finishes a normal event loop cycle and then starts processing the queued promise handlers.
This means that code that runs nicely in Node (for example) might not work the same way due to this behaviour.
Also, I also notice another thing: if JavaScript code makes a call to a native-provided method (e.g. by calling the setTimeout I show above, which I implement via a native-side handler) then during that call from JavaScript, it is possible for the native side to execute a call() and run Javascript code it wants. Again this is not what would happen in Node or Safari: it is not possible for timeouts (or network completions) to interrupt any 'builtin' function call, but in JavascriptCore it certainly is (to get around this I set a flag on the JavaScript side indicating a native call is being made, and if any native-triggered callback occurs on the javascript side when this flag is set, I have to 'queue' it via a promise handler for execution AFTER the current event loop is complete).
Are these known issues with Javascript core and are there ways to get around them?
thanks
I'm experiencing a persistent issue with transparent WebM videos rendered via WKWebView in an iOS Capacitor app. The videos display a black background frame, which does not occur in the web version of the app. I've tried:
Enabling experimental WKWebView features.
Adjusting meta tags for inline video playback and hardware acceleration.
That's my code:
<Carousel
showThumbs={false}
showStatus={false}
showIndicators={true}
showArrows={false}
infiniteLoop={true}
autoPlay={true}
interval={5000} // Change slide every 5 seconds
onChange={(index) => {
if (playerRefs.current[index]) {
playerRefs.current[index]?.seekTo(0);
playerRefs.current[index]?.getInternalPlayer()?.play();
}
}}
>
{videos.map((video, index) => (
<div key={index} className="video-slide">
<ReactPlayer
ref={(player) => (playerRefs.current[index] = player)}
url={video.src}
playing={isLoaded[index]} // Play only when video is loaded
loop
muted
width="100%"
onReady={() => handleVideoReady(index)} // Set loaded state when video is ready
style={{ backgroundColor: 'transparent' }}
config={{
file: {
attributes: {
playsInline: true,
},
},
}}
/>
<p className="description">{video.description}</p>
</div>
))}
</Carousel>
It is not occur in the web version of the app (testing with xCode).
I'm trying to use the simulator from Xcode to emulate an iPhone. I have created a sandbox account and logged in but pressing the Apple Pay button doesn't do anything. I have also tried the demo website for Apple Pay and that doesn't work either.
Does the simulator work at all for Apple Pay on the Web?