Explore the integration of web technologies within your app. Discuss building web-based apps, leveraging Safari functionalities, and integrating with web services.

General Documentation

Post

Replies

Boosts

Views

Activity

ios 18.0 im stuck on lockscreen
Dear Apple Support Team, I hope this message finds you well. I am writing to express my frustration and seek assistance regarding an issue I am experiencing with my new iPhone 15 after updating to iOS 18.0. Since the update, my device has become unresponsive and is stuck on the lock screen. I have attempted multiple troubleshooting steps, including resetting and restoring my iPhone, but unfortunately, none of these actions have resolved the problem. Here are the specific steps I have taken: I performed a force restart of the device by following the appropriate button sequence. I attempted to restore the device using iTunes/Finder by putting it into recovery mode, but the issue persists. I have ensured that my device is charged and that I am using the original charging cable. Despite my efforts, my iPhone remains unresponsive, and I am unable to access any of its features. This situation is quite concerning, especially considering that I rely on my device for daily communication and tasks. I would greatly appreciate any guidance or solutions you could provide to help resolve this issue. If there are any further steps I should take or if I need to bring my device in for service, please let me know. Thank you for your attention to this matter. I look forward to your prompt response.
2
0
184
1w
Safari 18: fetch() in safari extension does not include credentials
It seems Safari 18's fetch() does not include credentials even credentials: include and safari extension has host_permissions for that domain. Is there anyone has this problem? I try to request in popup.js like this: const response = await fetch( url, { method: 'GET', mode: 'cors', credentials: 'include', referrerPolicy: 'no-referrer', } ); and it does not include the cookie from host_permissions. Those code worked in Safari 17 (macOS Sonoma).
2
2
176
1w
WKWebView on iOS 18: Video Auto-Play Not Working Inline, Launching in Full-Screen Instead
Hello, I'm experiencing an issue with WKWebView in my iOS app when running on devices with iOS 18. Specifically, when auto-playing videos, they do not play inline as expected but instead switch to full-screen mode. This problem only occurs on iOS 18; in earlier versions, the videos played inline without any issues. Here is the configuration I'm using for WKWebView: let configuration: WKWebViewConfiguration = WKWebViewConfiguration.init() configuration.allowsInlineMediaPlayback = true configuration.mediaTypesRequiringUserActionForPlayback = [] Additionally, I have set the playsinline attribute in the video tag on the web page. Despite these settings, when the webpage initially loads, the video sometimes plays in full-screen mode rather than inline. I am looking for a solution to ensure that videos always play inline as intended on iOS 18. Has anyone encountered a similar issue or know of any workarounds? Any help would be greatly appreciated! Thank you!
1
1
186
1w
WKWebView on iOS 18: Video Auto-Play Not Working Inline, Launching in Full-Screen Instead
Hello, I'm experiencing an issue with WKWebView in my iOS app when running on devices with iOS 18. Specifically, when auto-playing videos, they do not play inline as expected but instead switch to full-screen mode. This problem only occurs on iOS 18; in earlier versions, the videos played inline without any issues. Here is the configuration I'm using for WKWebView: let configuration: WKWebViewConfiguration = WKWebViewConfiguration.init() configuration.allowsInlineMediaPlayback = true configuration.mediaTypesRequiringUserActionForPlayback = [] Additionally, I have set the 'playsinline' attribute in the video tag on the web page. Despite these settings, when the webpage initially loads, the video sometimes plays in full-screen mode rather than inline. I am looking for a solution to ensure that videos always play inline as intended on iOS 18. Has anyone encountered a similar issue or know of any workarounds? Any help would be greatly appreciated! Thank you!
0
0
216
1w
Xcode 16 JSGlobalContextCreate memory leak
The following has a memory leak on Xcode 16. JSGlobalContextRef _cx = JSGlobalContextCreateInGroup(NULL, NULL); #ifndef NDEBUG #ifdef __IPHONE_16_4 if (__builtin_available(iOS 16.4, *)) { JSGlobalContextSetInspectable(_cx, true); } #endif #endif JSStringRef ctxName = JSStringCreateWithUTF8CString("Xcode16"); JSGlobalContextSetName(_cx, ctxName); JSStringRelease(ctxName); JSGlobalContextRelease(_cx);
2
0
166
1w
run Http in webview local
hi, i have this problem. i need to use a webview to charge a file locally, to be more specific a file SCORM, like a mini web project. so i was making tests and the way to see all te content is in a http server. i mean if i click in the index.html of the file in my computer the page doesn't charge all the content, so i opened visual studio code and running Live Server thats provide me a project in http, well with that the project works. in android i'm make the example with something called WebViewAssetLoader, with that i can setup asset loader to handle local asset paths and override a WebView client, and if request is to local file, intercept and serve local. i want to know if in swift i have a way to intecept it a serve local this is one of the a lot of ways that i was tried and this is the example that works for me in android
2
0
194
1w
Safari extension - badgeText and title set for a tab
I am building Safari extension. In my background script I am setting badge text and title like this: browser.action.setBadgeText({text: badgeText, tabId: tabId}); browser.action.setTitle({title: badgeText + " found images", tabId: tabId}) , where tabId is correct id of current tab. I was expecting that in this way I am setting a different badge and title for different tabs, so that badge and title would automatically switch if I activate different tab. However this does not happen, badge and title behave as if set globaly and don't change with tabs. How is this expected to work? I have also tried to set badge globally, and update it every time user switches a tab. I have set up listener like this: browser.tabs.onActivated.addListener(function(actInfo) { console.log("switched tab to " + actInfo.tabId); }); , however the event never fires, tab switch is never logged in console. Am I doing something wrong here? This is my manifest, if there was a problem with permissions or something similar. { "manifest_version": 3, "default_locale": "en", "name": "Test", "description": "Test Extension", "version": "1.0", "icons": { "48": "images/icon-48.png", "96": "images/icon-96.png", "128": "images/icon-128.png", "256": "images/icon-256.png", "512": "images/icon-512.png" }, "action": { "default_title": "a test title", "default_popup": "popup/hello.html", "default_icon": { "16": "images/toolbar-icon-16.png", "19": "images/toolbar-icon-19.png", "32": "images/toolbar-icon-32.png", "38": "images/toolbar-icon-38.png", "48": "images/toolbar-icon-48.png", "72": "images/toolbar-icon-72.png" } }, "web_accessible_resources": [ { "matches": ["*://*/*"], "resources": ["images/*", "css/*", "scripts/lib/*"] } ], "background": { "service_worker": "scripts/background.js", "type": "module" }, "content_scripts": [ { "js": [ "scripts/content.js" ], "matches": [ "http://*/*", "https://*/*" ], "css": ["css/style.css"], "run_at": "document_end" } ], "permissions": [ "nativeMessaging", "tabs" ] }
2
0
136
1w
App not releasing memory immediately
We as a team of engineers work on an app intended to visualize medical images. The type of situations where the app is used involves time critical decision making for acute clinical conditions. Stability of the app and performance are of almost importance and can directly help timely treatment action. The app we are developing uses Javascript. It has been observed the footprint of the app is lagging by 2 to 3 seconds in releasing memory while javascript is expecting the memory to be cleared. This is affecting the stability of our application and preventing us in delivering the right quality of application. The problem specifically can be described as follows, using javascript create an array and then remove it and after removal of the array, create a new array of the same size immediately and again remove it. Because the memory is not released in time, if you repeat these steps a few times the app memory footprint will increase and that crashes the app. To reproduce this scenario, we have created a simple app which creates an array with size of 100MB and checks the memory footprint using the Xcode instrument tool. When we create an array of 100MB size, sometimes it shows the memory footprint peak of around 700MB-800MB and when we clear the array by assigning it with an empty array it releases the memory after 2-3 seconds. Considering the critical nature of the app, I urge you to look into this and provide necessary support and resolution. Please refer below sample code that will help to reproduce the mentioned scenario. import UIKit import WebKit class ViewController: UIViewController, WKUIDelegate { @IBOutlet var webView: WKWebView! let myHTML = """ <!DOCTYPE html> <html> <head> <style> .button-style { width: 400px; height: 200px; margin: 15px; font-size: 50px; } </style> </head> <body> <button type="button" class="button-style" onclick="loadDataInCache()">Load Data In Cache</button> <button type="button" class="button-style" onclick="removeDataFromCache()">Clear Cache</button> <script> const size = 1024 * 1024 * 100; let numberArray = []; function loadDataInCache() { numberArray = Array(size).fill(0); } function removeDataFromCache() { numberArray = []; } </script> </body> </html> """ override func viewDidLoad() { super.viewDidLoad() // self.view.addSubview(webView) webView.loadHTMLString(myHTML, baseURL: nil) } override func loadView() { let webConfiguration = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.uiDelegate = self view = webView } }
2
0
183
1w
Enable/disable Safari web extension content blocker using declarative_net_request in manifest
Is it possible to enable/disable the enabled flag before the extension is loaded? we want to have a button in our app which controls the availability of the content blocker ruleSet in declarative_net_request in manifest (version 2). "declarative_net_request": { "rule_resources": [ { "id": "ruleset_1", "enabled": true, "path": "ruleset_1.json" } ] },
3
0
175
1w
Options and Services in Safari with Selenium?
Firefox and Chrome provide various options and services to set up browser characteristics while testing. These can be used with Selenium while setting up the driver. An example with Firefox is setting a custom user agent and a download directory different than the default. Using Python: from selenium.webdriver.firefox.options import \ Options as FirefoxOptions from selenium.webdriver.firefox.service import \ Service as FirefoxService firefox_options = FirefoxOptions() # set up user agent user_agent = UserAgent().get_user_agent() firefox_options.set_preference("general.useragent.override", user_agent) # set alternate download location firefox_options.set_preference('browser.download.folderList', 2) firefox_options.set_preference('browser.download.dir', download_dir_path) Many of these browser-specific options and services are listed at Selenium's website under Supported Browsers. However, Safari's information is very limited. On Selenium's site, for example, they list how to turn on Safari's limited logging: service = webdriver.SafariService(service_args=["--diagnose"]). Then, they point us to About WebDriver for Safari - which shows automaticInspection and automaticProfiling. The page primarily describes security features for testing with Safari. In a regular user session, one can configure an alternate download directory, set a custom profile with specific settings for that profile, and so on. And, in the Developer Menu I can set some of these items manually for a given session (user agent, for example). How can I access these features within Safari for use in automated web testing with Selenium? Edit: Alternatively, does Apple have, or recommend, a different automated testing package for Safari?
0
0
106
1w
iOS 18 - Safari Extension turned on but not working & storage nuked
Hello, I am developer of a Safari Extension. I have had a few reports from users who have paid for my app and have upgraded to iOS 18 report that the extension isn't working any more. I upgraded myself and opened Safari, my extension was turned on but not working. I turned the extension off and back on, then it started working. However it did not have anything in browser.storage.local... so it has to be setup again from scratch for all of these users... This has been confirmed by multiple users. What the hell is this Apple? Why have you nuked Safari Extension storage when upgrading to iOS 18? And why does the extension stop working when upgrading to iOS 18? Nowhere near good enough... was this even tested?
2
1
233
1w
The difficulties of web development in the face of opaque inappropriate Safari autofill behavior
Through focussed debugging, I have discerned that if a web page's "text" input element's name attribute contains a dash (and does not contain -#- (e.g. -0-)), Safari will: Display a contacts icon inside the field and Add a drop-down populated with phone numbers from the user's contact card (on top of any pre-existing datalist dropdown). Ignore the element's autocomplete="off" There is post after post and blog article after blog article on the web that propose endless solutions to similar Safari issues, each working in various different contexts. It's a mess really. I am currently trying to develop a django web form for scientific data using django's FormSet class. Specifically, I was using FormsSet.empty_form to create a javascript clone-able form that would propagate field values to added (numbered) forms. I implemented things incrementally. I started out with a regular form and encountered a behavior where an autofill dropdown would present me with previously submitted values, e.g.: Adding autocomplete="off" to the input element prevented this. I then implemented formsets, defaulting to 1 form (so that all input elements' names started with form-0-) and everything worked as expected. However, when I changed the strategy with default to 0 initial forms and presented FormSet.empty_form as a template that would be cloned anytime files were dropped/selected, I started getting phone number drop-downs in all of the test fields: I googled this quite a bit and tried many things, including a strategy I'd employed before, to no avail, so to make debugging this issue easier and try a bunch of things quickly, I saved the page source and put it in the static folder, then started tweaking things to figure out what was causing this to happen. It appears that anytime a text input element's name attribute contains a dash (and does not contain -#-), Safari assumes it's a phone number field, despite the fact that the name's text, placeholder's text, possibly the label's text, the fact that the element has a list attribute set to the ID of a datalist element, and the fact that autocomplete is explicitly set to off. I would say that the heuristic used to trigger phone number autofill needs some serious tweaking. Not only that, but web developers need more transparency on how it works, so that non-sensical autofill behavior like this can be avoided. Another aspect of this is that if you have lots of cloned forms that Safari tries to apply autofill to, it dramatically decreases the page's performance. Safari autofill behavior has been a constant bane of mine, because many of our users use macs. I have not yet tried CSS solutions I've seen hints of (mainly because all the articles/posts I've seen about them are quite dated). Any information anyone can provide to tame Safari autofill and prevent this errant behavior would be much appreciated.
0
0
110
1w
Universal Linking not working
Hi Team, Universal linking is not working with safelink and when using the amazon SES. https://docs.aws.amazon.com/ses/ When we have email template and click on the links we are unable to open the app with safe links, does anyone faced this problem before for when using safe link with amazon SES or any other services. Please help me to resolve this issue as soon as possible.
1
1
121
1w
Content blocker extensions vs content blocking using Safari extensions for dynamic URLs
We have observed that blocking content using Safari web extension does not fetch few URLS within the #document (documentURLs) because the onBeforeRequest webextension API is currently not available in Safari iOS. But it works fine using the Content blocking extension. We have a list of URLs which we want to block from the website. Which extension would you suggest the Content blocking extension or the Safari web extension?
1
0
140
1w