I am new to PHP. I have developed my own web site with a lot of javascript in simple HTML files. I want to do some extensions with PHP but I can't make a simple web page function. I am sure something simple is wrong. Help!
Here is the test web page I made: hello.html
<html>
<head>
<title>Hello World</title>
</head>
<body>
<?php echo 'Hello World!'; ?>
</body>
</html>
Pointing Safari at hello.html gives me a new tab with the correct title, but no "Hello World" in the page itself.
Here is the output of php --version:
WARNING: PHP is not recommended
PHP is included in macOS for compatibility with legacy software.
Future versions of macOS will not include PHP.
PHP 7.3.24-(to be removed in future macOS) (cli) (built: Jun 17 2021 21:41:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies
Explore the integration of web technologies within your app. Discuss building web-based apps, leveraging Safari functionalities, and integrating with web services.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have a working Apple Pay transaction page that works on Safari. But with the new ios 18 update and Apple Pay JS library. I see that a pop up sheet with the scannable code is shown on chrome browser. I tried that.
Upon scanning the code with iPhone 15 pro max. The apple pay payment sheet is shown on the phone but with an error Service Unavailable. What do I have to do to make it work? What went wrong? I checked the logs and have no clue of what is failing.
I'm developing an application that needs smooth framerates within a wkwebview that interacts with native code. However, requestAnimationFrame by default is still throttled to 60hz even if all my target devices (the iPad Pro for example) have supported 120hz for a long time already. I noticed that the latest Safari in 18.3 beta supports unlocked framerates, but that's only under Safari feature flags. To my knowledge, these flags do not apply to WKWebView. Is there a way to enable unlocked framerate in WKWebView via requestAnimationFrame? (Calling JS at a faster rate from the native code side will not work, almost definitely, since WKWebView will still render at its own rate.)
This is an experimental application for internal use and I'm okay if there are temporary beta solutions available.
This is my first post, so please forgive me if it is to the wrong area.
I've been using Tahoe for a few days and, overall, it's very stable. But the one thing that has bothered me to no end is Safari's new behavior with respect to its header (Address bar, Favorite bookmarks bar, tab bar) background color. The web content of the active tab seems to affect everything - and oftentimes makes things completely unreadable - at least in "Dark" mode. For instance, if a web page uses a white background, the Favorites bookmark labels are the same color as the bookmark background, so reading the labels is simply impossible. At other times, they're just very difficult to read.
Similarly, it is almost always impossible to tell which tab is the active one - my only workaround is to try 100% brightness....or to just guess.
When Apple previously experimented with letting content bleed through to the top, there was a setting for stopping it - but I don't see such a setting anymore. Do you you know of any way to stop this effect?
On an older iPhone I'm testing with (6s, iOS 12.5.7), connected to the same Sandbox Apple ID that I'm using on multiple other devices, the Apple Pay button is not appearing. Neither on my web application, whatever version I set in the PaymentRequest, nor on the official demo site.
Further, 2 sandbox cards that were added fine to these other devices are failing to add on this one. Same cards and CVV codes are getting errors. At least "Invalid Card" on one of them. Although the other failed several times, then just worked this time when I tried it again :confused:
But on this phone, I have two cards successfully added, so the button should be appearing. On the demo site, whether I select Apple Pay JS API or Payment Request API, the button does not appear.
Hi everyone,
We work on a macOS plugin which then gets loaded into another application. I'm trying to load a webpage in that application through our plugin using a WKWebView & I set my class as the navigationDelegate for the same. I do not receive any callbacks for the WKNavigationDelegate methods. I have debugged & made sure that the navigationDelegate is actually set to my class. Here is a sample code of what I'm doing :
[[NSApplication sharedApplication] runModalForWindow:self.mWindowController.window];
- (void)windowDidLoad
{
[super windowDidLoad];
[self.window makeKeyAndOrderFront:self];
[self.window orderFrontRegardless];
if (self.mLoadingView == nil)
{
self.mLoadingView = [[LoadingView alloc] initWithFrame:[[self.window contentView] frame]];
}
[[self.window contentView] addSubview:self.mLoadingView];
[self.mLoadingView showLoadingView];
[self.window setLevel:NSMainMenuWindowLevel];
[self loadWebPage];
}
-(void)loadWebPage
{
[self.mWKWebView setUIDelegate:self];
[self.mWKWebView setNavigationDelegate:self];
[self.mWKWebView stopLoading];
NSURL *lURL = [self samplePageURL];
WKNavigation *lNavigation = [self.mWKWebView loadRequest:[NSURLRequest requestWithURL:lURL]];
}
- (void)webView:(WKWebView *)pWKWebView
didFinishNavigation:(WKNavigation *)pNavigation
{
[self removeLoadingview];
[self.mWKWebView evaluateJavaScript:@"document.body.setAttribute('oncontextmenu', 'event.preventDefault();');" completionHandler:nil];
}
I do not get any calls in the webView:didFinishNavigation: & I also tried other methods like webView:didStartProvisionalNavigation, webView:didFailProvisionalNavigation:withError: etc but did not receive any call in those either. Instead of runModalForWindow: if I use showWindow: on the mWindowController the webpage somehow loads but I still don't get any callbacks & so the loadingview subview is also present. The WKWebView is placed in a storyboard, and I have an IBOutlet connected to it in my class.
Has anyone faced a similar issue or can point me to something I might be missing? All help is appreciated. Thanks in advance.
Since iPadOS 18.x WKWebView seems to have a bug within its Fullscreen API (which can be enabled via WKPreferences.isElementFullscreenEnabled). This bug has the effect that websites trying to make an element (for example a video player) fullscreen fail to do so. This does not always happen, most of the time the fullscreen mode does work fine, but sometimes (far too often to be ignored) it does not. If an instance of WKWebView shows this issue, it can not be "fixed" by reloading the page or loading other pages, this issue exists in this instance forever.
My App is a web browser App so I can create and remove WKWebView instance easily (by opening or closing Tabs). And there are times where I never see this bug, and times where ever other tab shows this bug. It's totally unreliable.
The App does not show any issues at all when running under iPadOS 17 or older. The issue is only present under iPadOS 18.x.
After some testing I've found out that when the bug has affected an instance of WKWebView, the JavaScript call element.requestFullscreen() will work if the element is a video element, but does no longer work if it is another element (like a DIV). If an instance of WKWebView is not affected by this bug, element.requestFullscreen() will work for all HTML elements.
Does anyone has experienced this bug as well? And maybe found a workaround? Or maybe found a pattern which helps to find out what exactly is triggering this bug?
I have a content blocker that generally works correctly, but I need to block an element that has certain text in it.
For example, <span id="theId">Some text</span> is easy enough to block because I can locate the id and block that, but what if there is no id, or the id is completely random? What if it's just <span>Some text</span>? How do I block that?
Let's say this is my only content blocker rule:
[
{
"action": {
"type": "css-display-none",
"selector": ":has-text(/Some text/i)"
},
"trigger": {
"url-filter": ".*"
}
}
]
No errors are seen when the rule is loaded, so it's syntactically correct, it just doesn't block the HTML. I gather this is because :has-text() works on attributes, not contents, so it works on alt, href, aria-label etc. but not on the contents of the element itself.
How do I block Some text in my example above? Thanks!
Hello,
I'm facing the issue of not working sync of Safari tabs across my devices.
I'm currently on macOS 15.2 Public Beta and iOS 18.2 Public Beta and sync still doesn't work.
When I try to turn it off on all devices and set-up again it starts working and sync properly but only one time, than again stop working properly.
It's also described here as an issue: https://discussions.apple.com/thread/255767048?sortBy=rank
Topic:
Safari & Web
SubTopic:
General
Hi Apple Team,
We have a PWA which supports downloading and playback for audio and video content. Downloaded content is stored in IndexedDB in the form of blobs and blob URLs are generated on runtime through which content is played.
We have observed that the blob URLs have stopped working on iOS 17.4.1. They work on iOS 17.4 and iOS 17.3 as well.
This feature is very critical for us as it is the heart of the offline mode of the app.
Thanks!
iOS Safari 18.4/18.5 with IIS Windows Authentication with negotiate hangs after entering credentials
I don't think the issue is specific iOS 18.
We have a web application that runs with IIS Authentication of Windows and Anonymous. Initially the app opens and the user clicks a button and triggers the "401 Challenge" via ASP.NET. The browser presents the Active Directory login, user enters credentials, clicks Sign In, and the browser hangs (may actually be negotiating something). After a few minutes the user is logged into the application.
We have done a number of google searches/AI to try to determine what to change and there is no clear solution. Is there anything else to try?
This problem is not seen in Chrome on iOS or on a Windows machine. Strangely it is also not seen using BrowserStack with one of their "real" devices.
We have other apps that run with just Windows Authorization and this problem is not observed.
Topic:
Safari & Web
SubTopic:
General
Can someone please help me: I do not have the brain space (85yo) to figure out an Apple Script or Java Script app to do this simple task.
I have spent a few hours each day, over several days, and have made zero progress on such an apparently simple task.
I wish to create an Automator App for the macOS Safari browser that will schedule (via a Calendar Event) the download of the 48hr data behind the hourly Fuel Mix Plot Data from the AEMO Web Site, every Monday, Wednesday, Friday and Sunday.
Here is the link to the AEMO web site:
AEMO, Energy Systems, Electricity, National Electricity Market (NEM), Data (NEM),Data Dashboard
https://www.aemo.com.au/energy-systems/electricity/national-electricity-market-nem/data-nem/data-dashboard-nem
The 48 hour hourly Fuel Mix data is found by selecting the "Fuel Mix" button (which by default will display the NEM Current Trend).
The 48 hour trend is displayed by tapping on the small "Current" pulldown menu, and selecting "48 hrs".
The 48hr Data is down loaded by selecting the small circular button just to the right of the pulldown menu.
a) AEMO Web Site: https://www.aemo.com.au/energy-systems/electricity/national-electricity-market-nem/data-nem/data-dashboard-nem
b) Main Menu, and underlying html,
c) Fuel Mix menu, Pulldown list, DownLoad button, and underlying html,
I am familiar with C++ and have built Xcode Apps, and used Excel Macros extensively in the past.
Thank you.
Robert.
I have a Safari extension that plays audio via the javascript AudioContext API. It was working fine under iOS 17 and is now broken under iOS 18. It does not play audio at all.
I've tried in both the iOS 18 public beta and the iOS 18.1 developer beta. It is broken in both of them.
I've also created Feedback item FB15170620 which has a url attached to a page I created which demonstrates the issue.
I'd like to know the install state of my iOS safari extension in the associated swift app. Is there any way to get this? As we have seen it is available for macOS here, is there anyway to know iOS Safari extension is enabled or not?
Thanks
Even default Safari Web Extension project is not displayed on iOS 18.4 simulator ("No extensions installed"), so it's not possible to test extensions in simulator, only on real device.
Hi,
I'm developing a PWA and I'm experiencing a host of strange issues exclusively with Safari and push notifications, none of which happen with other browsers (Chrome, Firefox, Edge, other Chromium-based browsers). I've been testing primarily on mobile, so it may be (although it's unlikely) that desktop Safari behave differently.
The most severe issue is that the indexedDB global is undefined when the service worker is awoken by a push notification. This completely breaks things. I've recently updated to iOS 18.1.1 and I've seen this issue only recently, so it may be related to an update.
The notifications endpoint keeps changing and notifications are missed. This issue is weird to make sense of, but the gist of it is that, after restarting the app, registration.pushManager.getSubscription() will, seemingly incorrectly, give null, triggering a call (in our app) to registration.pushManager.subscribe, which will give entirely different subscription information.
"Deleted" notification endpoints keep on working (POSTing to them will return 201), instead of returning an error like Google, Microsoft & Mozilla do. This is perhaps not a critical, but it does complicate things on the backend, as we have few meaningful ways of automatically removing these endpoints.
This may be related to 2 in that the endpoint is "created" but "forgotten". Sometimes (quite often) pushing a push notification will not result in any notification on the device, even if the handler has debug code to always display a notification for incoming messages. The endpoint will return a 201 response code. I've added some logic to our server to send a push notification as soon as a new push endpoint is seen, and this notification is shown, so it's the "background" notifications that are somehow missed. Testing shows that this may be related to 2, as in instances where the endpoint remains consistent, notifications seem to be delivered.
Notification permissions are displayed inconsistently depending on the API used. Notification.permission seems to have the correct value, but navigator.permissions.query seems to always return 'prompt', regardless of the actual permission status. As a corollary to this, the onchange listener never seems to fire on Safari when a permission change occurs.
I've searched in this forum, the Web and the WebKit bug tracker, and haven't been able to find anyone else experiencing these issues, other than the inconsistency of querying permissions.
I suspect these are WebKit bugs, but it may also be that things are being done in a sequence that is "wrong" for Safari, which is not documented anywhere. Like I said, things work well in all other browsers.
I have code to share where the issues can be reproduced reliably, but I don't at the moment have a minimal example.
I would appreciate any help or direction with these matters.
Topic:
Safari & Web
SubTopic:
General
Our iOS app uses React Native Webview (based on top of WKWebView) to display content. This webview stays in memory throughtout the app's lifecycle. We are observing a high number of webview content process terminations - around 15% of our sessions. (https://developer.apple.com/documentation/webkit/wknavigationdelegate/webviewwebcontentprocessdidterminate(_:))
What could be the reasons for it? Is there a way to know for sure?
Is the 15% of sessions number something that other apps also experience, or should this be lower?
Thanks!
Topic:
Safari & Web
SubTopic:
General
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.
"The Referer header allows a server to identify referring pages that people are visiting from or where requested resources are being used. "
This header is never forwarded to server when the user is browsing the website in a WebView. This is properly maintained by other browsers but not in-app.
How do I include it?
Topic:
Safari & Web
SubTopic:
General
Our service includes the Apple web login feature to support "Sign in with Apple" on iOS 12.
However, at some point, an error started occurring on the Apple login page in iOS 12, preventing users from proceeding further.
Upon checking the Web Inspector console, we found the following error:
Failed to load resource: the server responded with a status of 503 (Service Temporarily Unavailable)
Please help us resolve this issue so that users can continue using "Sign in with Apple" on iOS 12.