Safari Developer Tools

RSS for tag

Inspect, edit, debug, and check the performance of your web content using Safari developer tools.

Posts under Safari Developer Tools tag

51 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Safari Responsive Design Mode Simulators are not showing up.
I have simulators downloaded to my 14" M2 Pro Macbook Pro, and for some reason, I cannot see any simulators as an option in Safari's Responsive Design Mode. Am I missing something obvious, or is my computer bugged? Above is an image of the Responsive Design Mode showing no simulators. I would offer more screenshots to prove that I have simulators installed, but it won't let me upload any more photos for some reason.
22
9
3.8k
4d
iOS 17.0 Webkit 'display:flex' issue
When rendering 2 'div' components with 'display:flex' placed on top of each other, the preceding one sometimes comes up. The 'position:absolute' has been set and the second 'div' component is being generated after the first one. However, when inspecting the iOS webview in Safari, I enable-disable the 'display:flex' property, everything starts working again. This is possibly a bug in the layout engine. I tried the same process in iOS 16.4 and there are no issues at all.
3
0
1.2k
Sep ’23
SessionNotCreatedError: Could not create a session: Some devices were found, but could not be used:
I am trying to automate Web app on iOS Safari for e2e test. Even though following code worked for emulator in iOS 17 beta, it seems not working on Real Device(iPhone 12, iOS 16.6). code for test describe("test0", () => { const getDriver = async () => { const options = new safari.Options() const capabilities = webdriver.Capabilities.safari() capabilities.setPlatform('ios') capabilities.set('safari:deviceType', 'iphone') capabilities.set('safari:useSimulator', false) const driver = new Builder().forBrowser('safari').withCapabilities(capabilities).setSafariOptions(options).build() return driver } let driver beforeAll(async () => { driver = await getDriver() }, 10000000) afterAll(async () => { await driver.quit(); }); test("test", async () => { await driver.get("https://google.com"); }, 1000000); }); Following error will happen when testing through real device while device is listed on Device and Simulators opened by Xcode > Window > Device and Simulators. SessionNotCreatedError: Could not create a session: Some devices were found, but could not be used: - iPhone (***-xxxxxxx): Remote Automation is turned off (turn it on via Settings > Safari > Advanced > Remote Automation) - [unknown wireless device]: device is not paired at Object.throwDecodedError (../node_modules/selenium-webdriver/lib/error.js:524:15) at parseHttpResponse (../node_modules/selenium-webdriver/lib/http.js:601:13) at Executor.execute (../node_modules/selenium-webdriver/lib/http.js:529:28) What I tried I turned on Safari > Advanced > Web Inspector, Safari > Advanced > Remote Automation, Developper > Enable UI Automation on iOS setting. I enabled safaridriver running safaridriver --enable. Versions XCode: 15.0 beta iOS: 17 beta
0
0
575
Aug ’23
Passwordless single sign on using SFSafariViewController in swift
0 I integrate with safriService (SFSafariViewController) to log in through a single sign-on password, the problem was the first time I log in using SFSafariViewController but the authentication follow not complete the first time so the safari browser still appear & can not direct into my app after authentication follow to become a success, another behavior is when I login again the authentication follow work fine & get the token then directed into my app fine so the main problem is the first time I login SFSafariViewController does not catch the user auth if let url = URL(string: "url") { let safariVC = SFSafariViewController(url: url) safariVC.delegate = self safariVC.dismissButtonStyle = .done present(safariVC, animated: true, completion: nil) } extension DouWebViewVC: SFSafariViewControllerDelegate { func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) { if didLoadSuccessfully { print("didLoadSuccessfully") // Do something with the URL here } } //initialLoadDidRedirectTo func safariViewController(_ controller: SFSafariViewController, initialLoadDidRedirectTo requestUrl: URL) { let absoluteUrl = requestUrl.absoluteString print("requestUrl(requestUrl)") } func safariViewControllerDidFinish(_ controller: SFSafariViewController) { print("safariViewControllerDidFinish") } }
0
0
618
Aug ’23
iOS 16.4 ASWebAuthenticationSession's webview can not debug in safari web inspector
I'm using Xcode 14.2 to build an app that runs on iOS 16.4. There is no webView.isInspectable property in this version. When my app presents a webview, it is inspectable in Safari -> develop, which is nice. However, when starting a ASWebAuthenticationSession, Safari -> develop shows "no inspectable applications". It was inspectable on iOS 16.1 but not iOS 16.4. How to solve this?
5
2
1.8k
Sep ’23
Browser.permissions.request not working as expected
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.
2
0
1.1k
May ’24
Simulate Device On Safari
Hey Developers! I love web design and am trying to test out some CSS, I am currently using a MacBook Pro 13" (2020 Version), I only use Safari and I want to know if I'm able to simulate other devices like a Windows 10 PC, an Android phone, an iPhone, or an iPad. I do own an iPhone and iPad but wanted to do it all on my Mac, I've tried searching for Safari extensions to do this but so far I haven't found one. If you could give me some suggestions or a link to what I should use it would be appreciated. Thanks, Mateo
3
0
18k
Sep ’23