amitbl / blocktube

YouTube™ content blocker
GNU General Public License v3.0
860 stars 60 forks source link

Safari Extension Support and Problems Identified in Prototype #282

Open KC-2001MS opened 1 year ago

KC-2001MS commented 1 year ago

I have prototyped this extension for Safari and would like to use it. https://github.com/KC-2001MS/BlockTube-for-Safari However, since I am not familiar with Javascript, I could not solve the problems caused by the porting. Instead, I would like to share the prototype and its problems here, and confirm the development policy of the Safari extension in this repository. Please note that the machine translation may be difficult to understand.

  1. Unable to create a repository that integrates Safari, Chrome, and FireFox extensions In this repository, Chrome and FireFox extensions are currently integrated and developed at once. However, since the format of Safari extensions is very different from the others, my ability to create an integrated repository is not possible and I have created a separate prototype. I need to consider whether to find a way to integrate them somehow or just develop them separately.

  2. Original implementation is required to realize device-to-device synchronization in Safari. If you are planning to implement Chrome synchronization or Firefox synchronization, this feature will not work with Safari extensions. This is because Safari does not fully support storage.sync. Note that this code works as local storage, so the extension itself will not stop working. If you want to implement a similar functionality, you will need to store data in the app's iCloud storage, not in the extension, and then pass that data to the extension as json data. If you want to implement the synchronization functionality in a Safari extension, you must rewrite the code for the Safari extension. If you want to implement synchronization functionality, you will not be able to develop Safari, Chrome, and FireFox extensions at the same time.

We would appreciate it if you could tell us about the development policy in this repository regarding the above problems you face in developing Safari extensions. We can cooperate with you on the conversion of Safari extensions, the implementation of the App side, and the release of the application. Mail : iroiro.work1234@gmail.com

Also, the Safari version currently has the following problems:

  1. iOS version does not work on m.youtube.com #278 This is a big problem. Even if the Safari extension is developed in a separate repository, we feel it would be more efficient to resolve it here, as we expect similar issues to occur on other mobile platforms.

  2. Error "Extensions on iPadOS must have a non-persistent background page." I was able to work around this error by changing the json to something like the following URL, but could not confirm if it affected the operation of the extension. https://developer.apple.com/documentation/safariservices/safari_web_extensions/optimizing_your_web_extension_for_safari

  3. Additional videos loaded are not filtered. In the extension I created, the block was working correctly when searching, but the additionally loaded thumbnails do not appear to have this block functionality working.

  4. "Block Channel" and "Block Video" buttons did not respond This part also seems to be a problem unique to Safari extensions.

amitbl commented 1 year ago

Hi, thank you for taking interest in porting the extension to Safari. Unfortunately, I'm not familiar with how Safari works regarding extensions and do not have the time or hardware (MacOS device) to work on this. You are of course free to fork the repository and work on this version yourself (as per GPL), I can try to help you if you need but do not expect prompt availability from me. If you can get the version to work at an acceptable level, we can talk about listing it on Apple store and link to it in the main repository.

For the issues you listed:

KC-2001MS commented 1 year ago

Sorry for the delay in replying. First of all, thanks for working on the mobile version of the extension.

As for the XHR function, I will check it out as far as I can; there are many parts of Safari extensions that are surprisingly unsupported, so that may be the reason.

Also, if there are any web developers who are interested in developing Safari extensions and have an environment, it would be helpful if you could let them know that we have a repository here.

I may not be able to solve all of them, since I mainly develop with SwiftUI, but I will try my best as much as I can.