Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari Support? #151

Open
austinarchibald opened this issue Jun 12, 2023 · 5 comments
Open

Safari Support? #151

austinarchibald opened this issue Jun 12, 2023 · 5 comments
Labels

Comments

@austinarchibald
Copy link

I'm trying to port this to Safari, using the Safari Extension Converter. Don't really know what I'm doing, but converted with no further edits to the code. It successfully built and installed as an extension in Safari. Settings page works, added server info, gave permission to work on every website, and pressing the button in Safari successfully loads the transmission web interface. However, when I right click on a magnet or torrent link > Torrent Control > Add torrent (or Add torrent (Advanced)), nothing happens.

When I load the web inspector for the extension, this is the js error I see after trying to add a torrent:

[Error] Unhandled Promise Rejection: TypeError: Argument 1 ('blob') to FileReader.readAsText must be an instance of Blob
	(anonymous function) (util.js:270)
	enqueueJob
	then
	(anonymous function) — index.js:126

Any suggestions? If I figure this out, I can fork and post releases for anyone wanting this capability on Safari (Mac & iOS). This repo seemed like a simple and reliable extension with updates and various client support. There are no torrent extensions for Safari that I could find.

@Mika-
Copy link
Owner

Mika- commented Jun 13, 2023

Error indicates that content script returns something other than a blob in content-script.js:17, or the FileReader API works a bit different way. Thats most likely due some differences in Safari.

Extension is written in cross-compatible way and works in Chrome, so it should work in Safari and Explorer as well. Atleast for a while, as it almost completely breaks after manifest v3 lands.

@Mika- Mika- added the support label Jun 13, 2023
@austinarchibald
Copy link
Author

Hmm. Any suggestions of something I can try to fix this?

@austinarchibald
Copy link
Author

There was also this when I first ran the converter, in case helpful:

austin@MacBook torrent-control % xcrun safari-web-extension-converter src/                                              
Xcode Project Location: /Users/austin/Downloads/torrent-control
App Name: Torrent Control
App Bundle Identifier: com.yourCompany.Torrent-Control
Platform: All
Language: Swift
Warning: The following keys in your manifest.json are not supported by your current version of Safari. If these are critical to your extension, you should review your code to see if you need to make changes to support Safari:
	protocol_handlers
	browser_style
	webRequestBlocking
	theme_icons
	default_area
	notifications
Warning: Persistent background pages are not supported on iOS and iPadOS. You will need to make changes to support a non-persistent background page.

@austinarchibald
Copy link
Author

Hi, just following up in case you had any ideas/suggestions of things to try. Thanks!

@Mika-
Copy link
Owner

Mika- commented Jul 2, 2023

You need to remove or try to find alternative methods to implement features that are relying those unsupported apis.
Note that those significally limit extensions usefulness as there would be no magnet link catching, no automatic torrent catching or notifications about failure/success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants