Safari Developer Tools

RSS for tag

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

Safari Developer Tools Documentation

Posts under Safari Developer Tools tag

98 Posts
Sort by:
Post marked as solved
2 Replies
349 Views
In Safari AppExtensions we have this API made available https://developer.apple.com/documentation/safariservices/sfsafariextensionhandling/3238030-contentblocker?changes=_8__2 optional func contentBlocker(withIdentifier contentBlockerIdentifier: String, blockedResourcesWith urls: [URL], on page: SFSafariPage) Is there something made available to WebExtension given WebRequest blocking isn't available in Safari.
Posted Last updated
.
Post not yet marked as solved
0 Replies
236 Views
Hey everyone. I need help with changing Safari's user agent permanently by editing the plist file Usually one would go to "Preferences > Advanced > Show Developer mode in menu bar." Then "Develop > User Agent > Chrome - windows" for example. However, when you open a new tab or window, this goes back to Default (Safari). This is expected behaviour. In the past, it was possible to edit a line that determined the user agent in "/Users/(user)/Library/Preferences/com.apple.Safari.plist" There was a line called: 'CustomUserAgent'. It's not there anymore. How can I create it (with defaults probably) with the user agent of Chrome (Mac)? Alternatively, is there another way to change it, or has the procedure changed? I called Apple Support to no avail. Thank you. Edit: Forum article for reference. This is an old trick as the CustomUserAgent string is not there anymore http://hints.macworld.com/article.php?story=20090630112653430
Posted Last updated
.
Post not yet marked as solved
0 Replies
299 Views
Requirement : Safaridriver provide option to disable Use Mock Capture Devices when use webdriver. Problem : In Mac OS, when use Safaridriver open a Safari browser for WebRTC samples, the audio input source only display Mock device (audio: Mock audio device 1/ Mock audio device 2 , video: Mock video device 1/ Mock video device 2) but not display Mac OS physical audio/video device . From safaridriver readMe, seems no configure can set Use Mock Capture Devices , because WebDrier test not support live media capture "For security reasons, Safari does not permit live media capture during a WebDriver test session. Instead, mock capture devices and streams with well-known contents are provided for testing purposes. " (In Mac OS, cd/Library/Apple/System/Library/CoreServices/SafariSupport.bundle/Contents/MacOS , man safaridriver)  From safaridriver debug log, safaridriver not provide any configure for disable Mock device. Reference : WebRTC samples link: https://webrtc.github.io/samples/src/content/devices/input-output/ safaridriver debug logs: [safaridriver.82081.txt] (https://developer.apple.com/forums/content/attachment/3806528b-d972-4459-8647-d4e6a4aae20a) Reproduce demo: SafariDriverDebug.java pom.xml dependency:
Posted Last updated
.
Post not yet marked as solved
0 Replies
260 Views
I´ve been creating a automatic Instagram Login for the past few days now but now I have encountered my probably biggest problem. Whenever I try to click on the "Not now" Button automatically for Remembering my Password on Instagram, which it does , Safari Crashes completely, not only the automatically processed tabs even the ones no Program is using. This is the code I use to press the "Not now" Button: new WebDriverWait(driver, Duration.ofSeconds(10)); WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); WebElement Nichtjetzt = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//button[text()='Not Now']"))); WebElement Notnow = driver.findElement(By.xpath("//button[text()='Not Now']")); ((JavascriptExecutor)driver).executeScript("arguments[0].click();",Notnow); When I now try to execute the Method it will press only essential cookies fill out my username and password and press the login button , but then when it gets to the Press Not now button it will press it and immediately crash. This will then be the Error Code: Safari Error Code Question Ending
Posted
by JK04.
Last updated
.
Post not yet marked as solved
22 Replies
14k Views
Safari 11.0.1/MacOS 10.13.1 is unable to maintain a web inspector connection with a web page on Safari iOS - iPhone 6, iOS 11.1.1. Almost immediate after the Web Inspector window opens, the connection is dropped and the window is basically dead.
Posted Last updated
.
Post not yet marked as solved
0 Replies
248 Views
In Monterey 12.3, I am no longer able to export a HAR file consistently. If I open the developer tools, and capture traffic, clicking on the "Export" button, or context-clicking and choosing "Export HAR" does nothing. I'm never prompted to save the file. At times, it does allow me to export a HAR file, but only about 1 in 10-20 page loads. It doesn't seem to be specific to a site, or specific to anything environmental...it just seems to not prompt. One other thing I've noted, when attempting to export the HAR file, Safari itself seems to freeze briefly (the spinning "beachball") - but after it starts responding again, there still is no prompt for saving the HAR file.
Posted
by Toonetown.
Last updated
.
Post not yet marked as solved
0 Replies
170 Views
Hi, I'm working on screen recording in Safari. After permission prompted and recording started I see red icon with "screens" next to search bar and the same icon but with white color in tray. After clicking on such icon I can see "pause" option. Is it possible to catch event from that action or disable such option at all? Screenshot:
Posted
by mobceri.
Last updated
.
Post not yet marked as solved
0 Replies
1.3k Views
While testing resource caching over Safari it's been observed that some of the information related to resource caching in the Network Tab of Web Inspector is wrong/misleading, or Safari may be having some random behaviour regarding resource caching.All our resources are using a "Cache-Control" response header with value "max-age=0, must-revalidate", so we're expecting that Safari will always revalidate with the server. Our resources are Javascript, CSS, and HTML static files.For these requests, where a 304 (Not Modified) response status is expected, Web Inspector is *sometimes* displaying a 200 (OK) response status, along with that a Transferred value of 0. Other responses properly display the 304 status along with 204 B size (the expected result). All requests display the Cached file as Yes.- Do you have any idea why some resources seem to have a 200 status + 0 bytes transferred, whilst others have the expected 304 status + 204 B transferred?- Could the 200 status + 0 transferred bytes mean that Safari isn't actually attempting to revalidate the resource with the web server? (all resources in the app are served with the same "Cache-Control" response header so we would expect Safari to behave in the same way for all.- Is there any place where information about the meaning of the different columns in Web Inspector tab can be found? (The Web Inspector guide seems updated only up to Safari 6.1).We're testing on Safari 9.1.3. I've reviewed release notes for all WebKit 10 releases but I couldn't find reports of any fix in this area of the browser.Thanks in advance for any inputs you may provide.
Posted
by imageneer.
Last updated
.
Post not yet marked as solved
15 Replies
22k Views
Problem :1 - Device is not shown in Safari when iOS device is connected and opened on a Safari Page.2 - I can see in Xcode that device is well detected by OSX.3 - it Stopped to work since Safari 13 release.Expected behavior :- See my connected device in OSX Safari to inspect itHow can i make it work ?
Posted Last updated
.
Post not yet marked as solved
1 Replies
316 Views
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.
Posted Last updated
.
Post not yet marked as solved
1 Replies
330 Views
Safari version : 15.3 Os version : 12.2.1 This is after latest updates and manifest v3 is not supported. So i need to downgrade manifest version to 2. What can be the solution to run manifest v3 with current mac and safari version? Also, My safari is not getting updated after updating os, Im using intel processor. What can be done to update safari version to 15.4?
Posted Last updated
.
Post not yet marked as solved
0 Replies
191 Views
I have read in lots of places on google related to this topic and everywhere its mentioned that webp is supportive after safari 14, but in my case its still not working. Also wants to know which image format should we use for good optimised website. Thank You.
Posted
by Rajesh619.
Last updated
.
Post marked as solved
20 Replies
33k Views
There used to be a 'Disable Caches' option on the Develop menu, but it's no longer present in Safari 11.0.It's very useful when developing not to cache the response from web servers. Is this an oversight?It seems the only option now is to use ⇧⌘R in web inspector.
Posted
by Tenz.
Last updated
.
Post not yet marked as solved
0 Replies
265 Views
Hi Developers, I created a custom oracle application which is working fine in Windows browser and android browsers, but not working within iframe in IOS15. Previously, it was working fine but after upgradation in IOS15 My application is not working any more within Iframe although it is working without iframe in same IOS testing Device which is useless for me. i am trying to fix this issue from last 6 months but unable to resolve. Any pointers to solve this issue will be greatly appreciated. Thanks in Advance
Posted
by MirzaUmar.
Last updated
.
Post not yet marked as solved
0 Replies
239 Views
I have problems with interacting with elements, such as clinking on a button. Steps: Create a new SafariDriver Navigate to a page with a button element Find the button element Click on the button element RESULT: The click is not performed on the button element. This is not working from the recent update to safari 15.3 The only workaround is to click using JavaScript.
Posted Last updated
.
Post not yet marked as solved
8 Replies
3.5k Views
I am using Selenium 3.141 with SafariDriver included with Safari 13.0.1 (14608.2.11.1.11).I have problems with interacting with elements, in this case clinking on a button.1) Create a new SafariDriver 2) Navigate to a page with a button element3) Find the button element4) Click on the button elementRESULT: The click is not performed on the button element but any element below the button element.This is not working from the recent update to safari 13.0.1.
Posted Last updated
.
Post not yet marked as solved
0 Replies
409 Views
I am trying to make a safari extension that will redirect some specific URLs to some other URLs. background.js function redirect(event) { console.log("called ") const redirectURL = "https://apple.com/" chrome.tabs.update(event.tabId, { url: redirectURL }) } // This works and redirects everything to apple.com chrome.webNavigation.onBeforeNavigate.addListener(redirect) /* tabs.update doesn't work as soon as URL filter is added, but the same piece of code works in a chrome extension but not in safari OnBeforeNavigate is called on accessing girlcodeit.com as the console statement is printed on accessing girlcodeit.com but tab is not updated. */ chrome.webNavigation.onBeforeNavigate.addListener(redirect, { url: [ { urlMatches: "https://girlcodeit.com/*" }, { urlMatches: "http://girlcodeit.com/*" } ] }) manifest.json "manifest_version": 2, "name": "", "description": "", "version": "1.0", "background": { "scripts": [ "background.js" ] }, "permissions": [ "webNavigation", "tabs" ] } How do I redirect only specific URLs and not all URLs or is there something wrong with the above piece of code, but because it works on chrome, it could be a bug in safari?
Posted
by mt2107.
Last updated
.