llelectronics / webcat

WebCat is a Webkit based webbrowser for sailfish os
19 stars 13 forks source link

Feature Request: " Magnet Links " #45

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hello llelectronics

Thanks in advance.

ghost commented 7 years ago

HI: LESNER

llelectronics commented 7 years ago

Yeah like you see I assigned this issue to me. I plan to take a look at it. Plan is to catch magnet links and transfer them over to xdg to open. This will then call the application that claims support for it. As Iam returning from my short vacation today it will take some time until I am settled in again and will be able to check it.

ghost commented 7 years ago
ghost commented 7 years ago

I already saw it! (88610dd) Thank You Very Much. YOU THE BEST!!!!

llelectronics commented 7 years ago

See the linked commit. It does what I said. Whenever a magnet: link turns up it ignores it and calls Qt.openUrlExternally which basically calls xdg-open on that url. So as long as you have something registering the magnet: mimetype/uri it should work.

ghost commented 7 years ago

HI: llelectronics I cloned to build webcat yesterday to testing magnet links, but look like not work yet, when i hit a magnet link icons on a website in webcat an open a small window saying "opening..." but nothing happen with other program. i downloaded 3 magnet link app supporting this features to see what happen. But none is seen to work. What do you think?

llelectronics commented 7 years ago

I have no clue. Try executing webcat from the terminal to see if it prints out any error message when calling Qt.openUrlExternally. Maybe those 3 magnet link apps don't register themselves as supporting magnet links.

ghost commented 7 years ago

| SailfishOS 2.1.1.24 (Jämsänjoki) (armv7hl) '--- [nemo@Sailfish ~]$ harbour-webcat [D] unknown:0 - Using Wayland-EGL [W] unknown:0 - WARNING: This project is using the experimental QML API extensions for QtWebKit and is therefore tied to a specific QtWebKit release. WARNING: The experimental API will change from version to version, or even be removed. You have been warned!

[D] openNewTab:174 - openNewTab: pagen5TNr, currentTab: [W] unknown:0 - QQuickWebViewExperimental::setUserStyleSheet is deprecated. QQuickWebViewExperimental::setUserStyleSheets should be used instead. [W] unknown:713 - file:///usr/share/harbour-webcat/qml/pages/FirstPage.qml:713:9: QML HorizontalScrollDecorator: Cannot anchor to an item that isn't a parent or sibling. [W] unknown:0 - QQmlExpression: Expression file:///usr/lib/qt5/qml/Sailfish/Silica/SilicaWebView.qml:143:16 depends on non-NOTIFYable properties: [W] unknown:0 - QQuickWebViewExperimental::transparentBackground [W] unknown:79 - file:///usr/lib/qt5/qml/Sailfish/Silica/SilicaWebView.qml:79: TypeError: Cannot read property 'orientation' of null

ghost commented 7 years ago

Have you tested llelectronics .?

llelectronics commented 7 years ago

The message is useless indeed as it does not show anything useful regarding this. I did not test anything yet. What should I test concretely? I don't have a clue about the torrent and magnet apps available for SailfishOS. Is there even one registering with magnet support?

llelectronics commented 7 years ago

Ok after some testing around it seems like Qt.openUrlExternally has some bug and does some strange encoding with the magnet link string which makes xdg-open fail to even recognize the string at all

ghost commented 7 years ago

OK . What would be the solution?

llelectronics commented 7 years ago

Fixed by using xdg-open directly in the c++ code by introducing my own "openExternally" function. (that does not use strange encoding). Please test with real magnet links to see if they are really working.

ghost commented 7 years ago

OK = )

ghost commented 7 years ago

Success : )

worked very nice ( tested tremotesf )
Many thanks . . .
llelectronics commented 7 years ago

Nice :)