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
1 Replies
51 Views
This is the last question I have to buy an iPad Pro. At the moment I only need to debug web pages in safari, but it would be ideal to also be able to debug applications. An alternative and very useful solution is the safari on the iPad Pro to have an inspection tool like in Chrome or Safari for desktop...
Posted
by Marks___.
Last updated
.
Post not yet marked as solved
0 Replies
56 Views
I am using Safari Technology Preview(16 version). With this version we can use Shared Worker, but how to debug it? For example, for Service Workers I see a separate menu item, but for Shared Workers I didn't find anything. Is there anyone who knows how to debug Shared Worker and see its logs?
Posted
by DmytroD.
Last updated
.
Post not yet marked as solved
0 Replies
48 Views
The Develop menu supports an option to disable restrictions for all websites, but is there a way to limit it to specific hostnames? What I really would like to use is a setting to make Safari behave like Chrome and Firefox which have not yet implemented these restrictions.
Posted Last updated
.
Post not yet marked as solved
1 Replies
76 Views
Project goal:  Publish on iPad html/css static multi page site, external style sheet, images, and maybe animated GIF clips or very short videos. This would get pushed to about 14,000 users for viewing and not require them any technical hoops to utilize. This must run offline from iPad Files storage no calls to server. Problem: Apple at some point disabled the ability to open local files in Safari. This means you cannot open an HTML file with relative src references such as <img src="test-image.png" alt="grrrrrr" /> You can only "open" or view the file via the Files app on iPad. I have tried changing advanced settings , disable local file restrictions etc for at least previewing my own work via developer mode, cabled iPad as an exercise in futility. Current Project state and or Limitation: "Publish" or saved single file HTML document to the iPad. View file in Safari - Unable not allowed File-name.html view via iOS Files app  Files app renders the html file with only the internal text and internal header contained CSS styling. Files app fails to load all relative source references such as  <img src="test-image.png" alt="grrrrrr" /> This is a huge roadblock to an otherwise simple project. Has someone built an iPadOS WebKit or Gecko app that will load and run a static site essentially just like any browser normally would on MacOS desktop environment ? Launch app | import site project folder/sub-folders | loads index.htm | renders and runs site A MacOS application that would essentially export a whole multi page mini site as a webarchive if you will that Safari on iPad would render correctly ? Maybe some Adobe Acrobat Pro functionality and or InDesign etc that would export some type of PDF chunk that would render as planned either in Safari or Acrobat Reader just like it should in the first place.....
Posted Last updated
.
Post not yet marked as solved
1 Replies
130 Views
I am building a safari extension app. the code(html, css, javascript) for the safari extension that is in the AppExtension directory works good, but when I added button to Main.html to make an Action, to make the app dynamically change (the application itself not the extension), and I want to send data from the app to the extension on Safari. Could anyone help me to fix this issue. This my html code: <!--Main.html --> <!DOCTYPE html> <html> <head>     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">     <meta http-equiv="Content-Security-Policy" content="default-src 'self'">     <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">     <link rel="stylesheet" href="../Style.css">     <script src="../Script.js" defer></script> </head> <body> <!--The makeAction() function is defined in the `Script.js` file -->         <button onclick="makeAction()">Dropdown</button> </body> </html> And this is the files structure
Posted
by osos.
Last updated
.
Post not yet marked as solved
3 Replies
1.8k Views
Hi I have installed IOS 15 beta and have problem with safari. The problem occurred when I closed one of the browser tabs, but when I turned on safari again, this tab came back. after I closed this tab a few times, the safari stopped working and I couldn't even turn on safari. When i click on the safari icon it won't turn on, it looks like i was opening and closing applications immediately safari before it loads.
Posted Last updated
.
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) { &#9;for (var key in changes) { &#9;&#9;var storageChange = changes[key]; &#9;&#9;console.log('onChanged triggered. '+ &#9;&#9;&#9;&#9; 'Storage key "%s" changed. ' + &#9;&#9;&#9;&#9; 'Old value was "%s", new value is "%s".', &#9;&#9;&#9;&#9; key, &#9;&#9;&#9;&#9; storageChange.oldValue, &#9;&#9;&#9;&#9; storageChange.newValue); &#9;} } /* 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 leggett.
Last updated
.
Post not yet marked as solved
1 Replies
181 Views
I have updated my mac OS from Big Sur(11) to Monterey(12.3.1) and I downloaded the latest Xcode version(13.3.1) but after this update, I can't able to see the simulator on the Develop menu under Safari. Can anyone help me with this?
Posted
by RanKal.
Last updated
.
Post not yet marked as solved
1 Replies
302 Views
Summary Safari "WebKit Build Archives" (AKA Safari nighties) crashes when opening Preferences. The Preference window doesn't even pop up before crashing. Steps to reproduce Download a nightly build of Safari https://webkit.org/build-archives/#mac-monterey-x86_64 Open run-webkit-archive Go got Safari > Preferences Observer crash Environment Does crash on: MacBook Pro (15-inch, 2017) macOS 12.2.1 and 12.3.1 WebKit Build Archives (249860@main, 249854@main, 249817@main, 292562) Spot checked a few others from Feb to April as well Do NOT crash on: Safari included with macOS 12.3.1 (Version 15.4 (17613.1.17.1.13)) Safari Technology Preview 143 (Safari 15.4, WebKit 17614.1.7.7) 142 141 Crash stack trace 2022-04-21 13:44:00.485 SafariForWebKitDevelopment[13786:133729] *** Assertion failure in -[NSMenuItem initWithTitle:action:keyEquivalent:], NSMenuItem.m:477 2022-04-21 13:44:00.487 SafariForWebKitDevelopment[13786:133729] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: aString != nil' *** First throw call stack: ( 0 CoreFoundation 0x00007ff8112d81e3 __exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007ff811038c13 objc_exception_throw + 48 2 Foundation 0x00007ff81217ac23 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 267 3 AppKit 0x00007ff813c74759 -[NSMenuItem initWithTitle:action:keyEquivalent:] + 363 4 Safari 0x00007ff91e63417a +[NSMenuItem(BrowserExtras) safari_menuItemForFileAtPath:] + 140 5 Safari 0x00007ff91e505a0b -[GeneralPreferences _updateDownloadLocationMenu] + 158 6 libdispatch.dylib 0x00007ff810fda0cc _dispatch_call_block_and_release + 12 7 libdispatch.dylib 0x00007ff810fdb317 _dispatch_client_callout + 8 8 libdispatch.dylib 0x00007ff810fe7c78 _dispatch_main_queue_drain + 943 9 libdispatch.dylib 0x00007ff810fe78bb _dispatch_main_queue_callback_4CF + 31 10 CoreFoundation 0x00007ff81129a9c7 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 11 CoreFoundation 0x00007ff81125b93f __CFRunLoopRun + 2771 12 CoreFoundation 0x00007ff81125a7ac CFRunLoopRunSpecific + 562 13 HIToolbox 0x00007ff819ee1ce6 RunCurrentEventLoopInMode + 292 14 HIToolbox 0x00007ff819ee1a4a ReceiveNextEventCommon + 594 15 HIToolbox 0x00007ff819ee17e5 _BlockUntilNextEventMatchingListInModeWithFilter + 70 16 AppKit 0x00007ff813c8153d _DPSNextEvent + 927 17 AppKit 0x00007ff813c7fbfa -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394 18 Safari 0x00007ff91e16d8b5 -[BrowserApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 224 19 AppKit 0x00007ff813c722a9 -[NSApplication run] + 586 20 AppKit 0x00007ff813c46227 NSApplicationMain + 817 21 Safari 0x00007ff91e1581c0 SafariMain + 464 22 dyld 0x000000011583e51e start + 462 ) libc++abi: terminating with uncaught exception of type NSException MessageReceiveQueueMap::addImpl - adding duplicate any id receiver 35
Posted Last updated
.
Post not yet marked as solved
0 Replies
649 Views
Hi, I have an extension on which I have allowed "foo.com", but then from permissions in manifest.json I removed "foo.com" then re-built the extension but still see "foo.com" in the extension's permissions list in preferences. Then I uninstalled the extension and re-built, still I can see "foo.com" in the list and allowed, it should not have been there, as I have removed now. How do I reset an extension in Safari? If even uninstalling and reinstalling is not working? Thanks
Posted
by AjeetRE.
Last updated
.
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 gsumit.
Last updated
.
Post not yet marked as solved
0 Replies
159 Views
looking for help to remove debug of the safari menu bar, i added it over a year ago and wanted to remove it. i will be migrating from back my 2012 MacBook Pro to my new 2021 MacBook Pro M1 Max. I did not want the debug on safari migrated over. i have a MID 2012 MacBook Pro that is up to date, mac OS Catalina 10.15.7, Safari is 15.4, Terminal is 2.10 (433) i have run this command in terminal, defaults write com.apple.Safari IncludeInternalDebugMenu 0 all that shows after the command is my name with the % Im using the correct default shell in terminal bin/zsh I tried to remove debug in both bash and zsh i am not getting any error, i ran the terminal command without safari running and i have restarted my MacBook Pro after running the command. when i open safari Debug is still in the menu bar. i ran this command defaults read com.apple.Safari this is what shows, { IncludeInternalDebugMenu = 0; }
Posted
by bikeman5.
Last updated
.