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 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
Post not yet marked as solved
2 Replies
2.2k Views
After watching WWDC 2016 session 420, Optimizing Web Content in Your App, I added "com.apple.webinspector.allow = YES" to the existing entitlements file.Build & Run results in immediate crash. Reviewing the crash log reveals Exception Type: EXC_CRASH (Code Signature Invalid)Remove that row from the entitlement file and the app runs fine.How can this be fixed, so that the app may connect to the Safari developer tools?
Posted
by
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
Post not yet marked as solved
1 Replies
358 Views
I have successfully integrated Safari push notifications to my website and everything works fine for now. I foresee one problem though, which unfortunately is not covered in Apple Documentation at all: the push package is downloaded only once when a users accepts to receive pushes from my website.But what if I ever decide to change the iconset, websiteName or the urlFormatString in the website.json file of the push package? Is there any way to force update the old push package my existing subscribers already have with a new one?
Posted
by
Post not yet marked as solved
3 Replies
1.9k Views
Hi All,I got a requirement to integrate Apple pay to our E-commerce website. This is intended only to run in safari mobile browsers. I am in search for a way to automate the apple pay integration. We will have an option from cart page to choose Apple pay. Once user selects this a panel is displayed which have options to select the saved credit card, addresses in the mobile phone (we call this as apple payment sheet). These informations are prefilled but user can change this. I believe this is some kind of native code which displays this panel above the safari. I need to device an end-to-end test which has both normal web simulation and the payment sheet simulation so that it could complete an order successfully.For this, I have few roadblocks:1. We need a common tool which can simulate user interaction in mobile web (this is currently done by webdriverIO) and the payment sheet provided by safari for apple pay(No idea how to inspect or simulate user interaction on this panel).2.We need to simulate fingerprint authorization from the test automation tool. I am still to get a solution for this. Have considered many tools but found out that none of them can help. Not sure about the capabilities of Appium in this regard. It would be of great help if someone can point me in the right direction of choice of tool that can be used here.Regards
Posted
by
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
by
Post not yet marked as solved
4 Replies
5.1k Views
Hi,I added a Content-Security-Policy that works in Firefox and Chrome but not Safari. I am using Safari 10.1.2. In Safari I get the error:“Refused to apply a stylesheet because its hash, its nonce, or 'unsafe-inline' does not appear in the style-src directive of the Content Security Policy.”So, I tried adding ‘unsafe-inline' to style-src but I still get the error in Safari. I have some hashes in style-src (that were provided by Chrome), and when I get rid of the hash, Safari gives no errors as long as I have ‘unsafe-inline’ written. If I put the hash back in, I get the error again in Safari. The other browsers work fine. Does anyone know what I can do to get the Content-Security-Policy working in Safari? Any help is greatly appreciated!
Posted
by
Post not yet marked as solved
7 Replies
7.6k Views
On 10.12.6, selecting Allow Javascript from Apple Events from the Develop menu does not stick.Steps to reproduce-Develop menu > Allow Javascript from Apple EventsClick "Allow" in the dialog box.Result: Develop menu shows the setting UNchecked.Tested with defaults read shows it is enabled (1).Writing defaults completes without error.Tested in different user account.Tested with Safari beta 11.1.1, and Technology Preview
Posted
by
Post not yet marked as solved
3 Replies
4.0k Views
Hi,I have been struggling to understand how the smart app banners are displayed in safari even though no meta tag is present on any of our website page. My assumption is that, apple-app-site-association file is being used automatically to display the banners on our website, is this true?I have read through all the documentation and WWDC videos from 2015(Session 509) to make sure this assumtion is valid but unfortunately there is no link between the smart app banners and apple-app-site-association file.My requirement is: We still want to support the universal links but remove the smart app banners on our website.Thanks,Sumit
Posted
by
Post not yet marked as solved
1 Replies
1.6k Views
I'm working on a native Cocoa app that has a few WKWebViews.When the app is running, I can open the Web Inspector by clickingDevelop > My Computer > Document.titleHowever when I re-run the app from Xcode, the Web Inspector disappears.I'd expect that the following toggle in Safari would do what it says, that is, open a new inspector as soon as my app runs again. However this doesn't work.Develop > My Computer > Automatically Show Web Inspector for JSContextsSeems like a bug. Is there anything I can do to automatically get a Web Inspector on each re-run?
Posted
by
Mic
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
by
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
by
Post not yet marked as solved
2 Replies
617 Views
I have an app which uses the Safari View Controller to launch a website. That website has the fucntionality of downloading attachments. The downloading fucntionality was working differently until iOS 12.4.1 and now in iOS 13, apple has introduced the download manager in Safari.That's fine, but in the app's Safari View Controller, there is no Dnwnload Manager button shown on the top right.I can see another difference between the Safari Browser and Safari View Controller. In Safari, while tapping on the attachment link, a popup is displayed to donwload or view the attachment. But in Safari View Controller, while tapping the same attachment link, its displaying a screen fo "More.." and Open In "AnyApp which handles documents"
Posted
by
Post not yet marked as solved
0 Replies
759 Views
Service Workers are difficult to debug without proper tooling. Current tools available in Safari makes it difficult to understand the lifecycle of the SW, the Cache Storage contents, to reload or remove registration and other actions. It's even more difficult when doing remote debugging to an iOS or iPadOS device where the Service Workers appears as a different context without proper explanation.
Posted
by
Post not yet marked as solved
1 Replies
817 Views
I am automating angular site using protractor and the site but default needs to have ssl and therefore I added self signed certs to the site but when i run automation on safari i am trying to auto-accept the warning saying this is a not trusted site. I found that i can use acceptInsecureCerts: true in protractor to ignore SSL but for some reason Safari is not recognizing this option. A similar behavior is seen on ios devices as well. Is there a way to bypass the ssl certs on Safari? This is the error i got from safari webdriver for desktop: Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'L502062.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.5', java.version: '1.8.0_202' Driver info: driver.version: unknown remote stacktrace: 		at Object.checkLegacyResponse (C:\Users\x200866\Documents\emr-vv-client\node_modules\selenium-webdriver\lib\error.js:546:15) 		at parseHttpResponse (C:\Users\x200866\Documents\emr-vv-client\node_modules\selenium-webdriver\lib\http.js:509:13) 		at C:\Users\x200866\Documents\emr-vv-client\node_modules\selenium-webdriver\lib\http.js:441:30 		at processTicksAndRejections (internal/process/task_queues.js:97:5) [13:00:42] E/launcher - Process exited with error code 100
Posted
by
Post not yet marked as solved
6 Replies
1.5k Views
I'm trying to use browser.storage.onChanged - https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/onChanged to detect when changes are made to browser.storage.local where I save all the preferences for my Safari Web Extension. This works on Chrome, Firefox, Edge, and Opera. But I can't get it to work on Safari. When I call browser.storage.local.set, the onChanged listener is not called. Below is the code I'm using to test this in Safari. This has to be in an extension with the Storage permission. - https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions Given this works in all other browsers and I'm following the documentation, I'm inclined to believe this is a bug in Safari. Am I missing something? /* Function to handle changes to storage */ function handleChange(changes) { 	for (var key in changes) { 		var storageChange = changes[key]; 		console.log('onChanged triggered. '+ 				 'Storage key "%s" changed. ' + 				 'Old value was "%s", new value is "%s".', 				 key, 				 storageChange.oldValue, 				 storageChange.newValue); 	} } /* Add listener for storage changing */ browser.storage.onChanged.addListener(handleChange) /* Confirm that the listener has been attached (expect "true" to be returned)*/ browser.storage.onChanged.hasListener(handleChange) /* Set value for ['testKey] (should trigger onChanged event which calls handleChange) */ browser.storage.local.set({testKey: true}, () => { console.log('Storage updated'); }); /* Get current value for ['testKey] in storage.local, should return {testKey: true}*/ browser.storage.local.get(['testKey'], (result) => { console.log(result); }); /* Change value for ['testKey] (should trigger onChanged event which calls handleChange) */ browser.storage.local.set({testKey: false}, () => { console.log('Storage updated'); });
Posted
by