ajayyy / SponsorBlock

Skip YouTube video sponsors (browser extension)
https://sponsor.ajay.app
GNU General Public License v3.0
10.33k stars 326 forks source link

Build Safari extension for iOS 15 #808

Closed ajayyy closed 3 years ago

ajayyy commented 3 years ago

Now that an official Safari extension is available, it should be possible to build this for iOS 15 as well

https://github.com/ajayyy/SponsorBlock/wiki/Safari

rakleed commented 3 years ago

Until iOS 15 is released, it will likely not be possible to publish the extension in the App Store, but it can be redistributed through TestFlight. There are already some extensions that work in the beta version of Safari for iOS.

sohansubhash commented 3 years ago

iOS 15 released earlier this week. Do you guys think the existing Safari Extension can be modified to include iOS devices as a built target?

ajayyy commented 3 years ago

The cloud mac service I used doesn't offer the new macos version in the pay as you go plan yet, so I'll have to look at other options

evanreichard commented 3 years ago

FYI: I was able to compile SponsorBlock for iOS 15 / iPadOS 15. Used the instructions to convert the extension to Safari (Not sure if this is actually needed, I still loaded resources from the ChromeExtension folder). Then created a basic extension by following these instructions.

I also added the remote.js source from AdguardTeam/BlockYouTubeAdsShortcut to the content_scripts in the manifest so it would automatically block YouTube ads as well. (No need to "share" it to AdBlock, now)

sohansubhash commented 3 years ago

@evanreichard I was able to reproduce your steps!

I believe that running xcrun safari-web-extension-converter /path/to/extension already creates both an Xcode project with both Mac, iOS extension and app targets (I don't need think you need to manually create a new extension project).

I just had to make slight changes to the publishing settings following the wiki instructions.

The Adguard remote.js script seems out of date compared to the bundled script with the Adguard for safari app. The remote script still worked but did not fully block ads, it still shows the skip add button.

ajayyy commented 3 years ago

I bit the bullet and bought a used macbook.... Will see how it goes once I receive it. Should be simple once I can download the latest xcode

ajayyy commented 3 years ago

image

Update: I got my mac and got it working on simulators, but Apple really loves adding obstacles...

FlorianWendelborn commented 3 years ago

@ajayyy that almost sounds like "please give us some more money before you can publish your software to enrich our ecosystem"

ajayyy commented 3 years ago

Should be up https://apps.apple.com/ca/app/sponsorblock-for-youtube/id1573461917

cwille97 commented 3 years ago

@ajayyy Really glad to see this on iOS! Working great on the YouTube website so far, but is it possible to update the safari extension to work on Invidious instances as well? I think the desktop browser extension works with Invidious but maybe there’s a blocker there on iOS?

ajayyy commented 3 years ago

@cwille97 That's covered by https://github.com/ajayyy/SponsorBlock/issues/798, but the current method of dynamic-domain scripts doesn't work on Safari unfortunately

FlorianWendelborn commented 3 years ago

@ajayyy thanks for combining this with the macOS Safari version. I fully expected to pay again for iOS and decided to donate instead