Post

Replies

Boosts

Views

Activity

Reply to Safari extension doesn't load
Hey, so I think I just went through this last night. Was very annoying. Xcode only attaches the files if I run the xcrun converter script and load the sample app that comes with it, works fine if I'm just testing the extension, but that doesn't solve the issue of bundling an extension into my actual production app. I believe the issue is a bug with Xcode that doesn't actually copy the extension content files over. I tried copying, moving, and using symbolic links (default). It's so frustrating having to deal with Safari extension bugs so frequently (check my post history). Like @david_tejada, I have had a production app on the App Store for over 2 years now, and wanted to add a new feature and roll it out to our users but then came across this bug that doesn't throw any errors... I want to piggyback on his frustrations with Safari Extension development as well, and I'm sure many of us share these same frustrations: Enduring 5-15 minute build times for small tweaks to a button, because you have to side load the extension into an app. Of course, the something silently broke in the extension, no biggie, let me debug it. Oh, wait, the service_worker doesn't show up in the Develop menu (if it was even loaded in the first place). Forced to load it into Chrome just to see if it runs (it does, flawlessly - and it took 3 clicks and changes are instant with Hot Reloading) Spending hours/days/weeks scouring the internet for that very tiny chance someone else found a solution (rarely ever happens) Write a post about it on the forums just to have the trillion dollar dev team tell you to file a bug report that I pay $99/year just to have the privilege to? Make it make sense. Anyways, the answer is below. Solution: I used this answer as the basis for the logic (if you have enough StackOverflow reputation please upvote it): https://stackoverflow.com/a/79412831/19708203 I did make a small tweak to his solution, by removing the pre-generated Copy Bundle Resources Build Phase completely. I also am using a script to auto-generate the Input and Output File Lists (I didn't use single files like he did). See my setup in the image attached. I was able to automate the above with some post-prebuild scripts (npx expo prebuild - I'm using Expo React Native so was able to create a custom Expo plugin. Sorry, I'm not sure what the Xcode equivalent is, but PM me if you want the script nonetheless)
Topic: Safari & Web SubTopic: General Tags:
Apr ’25