erosman / support

Support Location for all my extensions
Mozilla Public License 2.0
170 stars 12 forks source link

[FireMonkey] Work on Fenix #238

Open linsui opened 3 years ago

linsui commented 3 years ago

I failed to make it work on fenix. My user style doesn't work. Is this an issue on Fenix or this addon? Will Fenix be supported? Thanks!

erosman commented 3 years ago

I have not worked on Firefox for Android as I dont use Android.

Maybe in future ...

linsui commented 3 years ago

Oh, I'll wait... 😂

erosman commented 3 years ago

Previously #206

linsui commented 3 years ago

I'm debugging FireMonkey on Fenix. I found that some unsupported apis prevent the background.js from working.

browser.menus.create in line 25. extraParameters in browser.tabs.onUpdated.addListener in line 57 and 409. I removed them and then it works on Fenix. Could you please take a look? I thought that these apis can be checked before called. Thanks!

erosman commented 3 years ago

I'm debugging FireMonkey on Fenix

Great :+1: ... I have been trying to find a small emulator to run Firefox on Android so that I can test it, but haven't found any yet. There are some 100-200mb emulators that work fine with Google Chrome but Firefox for Android doesn't support them. :frowning_face:

I am open to suggestions. How are you doing it?

browser.menus.create in line 25.

That shouldn't be a big issue if the menus are omitted.

extraParameters in browser.tabs.onUpdated.addListener in line 57 and 409.

Line 57 is for the counter which is useless on Andriod.

Line 409 deals with installing userScript & userCSS when loaded in the tab. That can be removed, but it reduces the functionality.

📌 I will start adding some system checks for Android from the next version 2.12.

linsui commented 3 years ago

How are you doing it?

I just remove those unsupported apis or parameters in those lines and then at least the CSS and script works well. There is still something which doesn't work but the main function works well.

📌 I will start adding some system checks for Android from the next version 2.12.

Thanks very much!

Another feature request: The setting page looks awful on small screen. Could you please make it responsive?Thanks!

erosman commented 3 years ago

How are you debugging on Android? Are you debugging directly of form a different computer?

linsui commented 3 years ago

Since I have an Android device, it's easy. See https://extensionworkshop.com/documentation/develop/developing-extensions-for-firefox-for-android/.

Are you debugging directly of form a different computer?

From a computer.

erosman commented 3 years ago

Since I have an Android device, it's easy. See https://extensionworkshop.com/documentation/develop/developing-extensions-for-firefox-for-android/.

I have Windows 7. I installed Android Studio and then It asked for SDK and installed that and then asked for more & more and the asked for HAXM is not installed and asked for OS update.... so after downloading and installing over 3gb of software, I gave up & uninstalled them all.

I am trying Remote Debugging but it hasnt recognised the Android phone. :frowning_face:

Also ... Debugging Firefox for Android with WebIDE

linsui commented 3 years ago

I have Windows 7. I installed Android Studio and then It asked for SDK and installed that and then asked for more & more and the asked for HAXM is not installed and asked for OS update.... so after downloading and installing over 3gb of software, I gave up & uninstalled them all.

I'm not a developer so I don't have AS installed but only an adb. I don't know how to use the emulator... It requires too much resource for me.

erosman commented 3 years ago

So you have ADB and debug from Firefox browser on your desktop? The MDN docs are written for old FF and they are not clear.

It doesn't come up for me.

image

When I also try the setup from How to Install ADB on Windows, macOS, and Linux but List of devices attached is empty

How to Install and Use ADB, the Android Debug Bridge Utility says if the list is empty you have to install drivers.

I am installing Android USB Driver for Windows to see what happens.

linsui commented 3 years ago

So you have ADB and debug from Firefox browser on your desktop?

Yes! I have adb installed and USB debugging enabled on Android. When I open the debugging tools in Firefox the devices is displayed in the sidebar.

When I also try the setup from How to Install ADB on Windows, macOS, and Linux but List of devices attached is empty

I just do the same thing as the steps in the picture.

erosman commented 3 years ago

I installed Samsung drivers and now it shows up. I am going to try it now.

How do you install addons via the debugger?

linsui commented 3 years ago

How do you install addons via the debugger?

I use the web-ext to install the add-on automatically.

erosman commented 3 years ago

Have you tried the last update? (nothing about Options page yet) I have set the compatibility with Android so you can install it from AMO.

linsui commented 3 years ago

Thanks! I just tried the new version. Some styles and scripts work for me but others not. As soon as I'm on pc I'll do more test.

Edit: I just restart firefox and it seems all my styles and scripts work well. Thanks again! Now FireMonkey is the best style and script manager IMHO!

linsui commented 3 years ago

The popup on Fenix can't display compeletely. The body is larger than the window and can't scroll. Following css works:

body {
  color: var(--color);
  background: var(--bg);
  padding: 0;
  font-family: sans-serif;
  width: 100%;
  box-sizing: border-box;
  overflow-y: scroll;
  margin: 0;
}

But maybe it's better not to set a hard code height here:

ul {
  list-style: none;
  padding: 0.1em;
  margin: 0;
  overflow-y: auto;
  height: 10em;
  scrollbar-color: var(--scrollbar);
  scrollbar-width: thin;
}

ul.other {
  height: 22em;
}

By the way, the popup on desktop also not fit the window in 2.17 . Thanks!

erosman commented 3 years ago

By the way, the popup on desktop also not fit the window in 2.17 .

@linsui Do you mean the overflow menu or normal?

linsui commented 3 years ago

The overflow menu. sshot-001

erosman commented 3 years ago

That was intentional until I find a proper way to do it.

erosman commented 3 years ago

AFA fenix popup, I still cant install FM on my mobile although the blog Extensions in Firefox for Android Update said it should be possible.

linsui commented 3 years ago

For now only nightly and some unofficial builds (iceraven, fennec fdroid) support installing any addons through collection.

erosman commented 3 years ago

I tried with Nightly but it only accepts via collection and not direct from AMO. :facepalm:

linsui commented 3 years ago

Though Mozilla said that installing from AMO is supported in 85 but looks like only recommended addons are supported.

erosman commented 3 years ago

overflow-y: scroll;

That breaks the slide t info page.

But maybe it's better not to set a hard code height here:

Then it looks poor on normal Firefox. Without the hardcoded height, it expands beyond the allowed height.

I dont know if there is a way to separate the CSS for Fenix from Firefox?. :thinking:

linsui commented 3 years ago

Then it looks poor on normal Firefox. Without the hardcoded height, it expands beyond the allowed height.

I guess max-height works? :joy: I took a look at uBO's code but didn't find special things.

Iey4iej3 commented 3 years ago

Here are some comments:

  1. Violentmonkey is already available on Iceraven, so maybe we could learn how to do things properly on Android.
  2. One could debug Android programs without Android devices. In fact, there is an official emulator: https://developer.android.com/studio/run/managing-avds
erosman commented 3 years ago

One could debug Android programs without Android devices. In fact, there is an official emulator:

That is a very large resource hungry dev IDE.

Iey4iej3 commented 3 years ago

One could debug Android programs without Android devices. In fact, there is an official emulator:

That is a very large resource hungry dev IDE.

It would occupy spaces, but it could be started from command line: https://developer.android.com/studio/run/emulator-commandline

And seemingly there are standalone packages. I don't know the one for Windows, but Debian has one: https://packages.debian.org/bullseye/google-android-emulator-installer

Iey4iej3 commented 2 years ago

Another possibility is to run Android apps on Windows 11: https://blogs.windows.com/windows-insider/2021/10/20/introducing-android-apps-on-windows-11-to-windows-insiders/

Iey4iej3 commented 2 years ago

I find a script (https://greasyfork.org/zh-CN/scripts/396171-%E7%9F%A5%E4%B9%8E%E5%85%8D%E7%99%BB%E5%BD%95 ) which does not work under Fennec F-Droid with FireMonkey. It does not work under Fennec F-Droid with ViolentMonkey either (https://github.com/violentmonkey/violentmonkey/issues/1447), but it works with TamperMonkey.

erosman commented 2 years ago

re: 知乎免登录

Why does it have @grant GM_xmlhttpRequest when it doesnt use it? :thinking:

It uses new XMLHttpRequest() in line 507 and it may be an issue (ref: Bug 1715249). If that is the case, then new window.XMLHttpRequest() could be used.

Does the script work on Desktop Firefox?

Iey4iej3 commented 2 years ago

Does the script work on Desktop Firefox?

Thanks for the prompt. I did not know how to test it on desktop (the restriction that I want to avoid is only on the mobile site), but now I realize that I could change UA, and after that, it does not work on desktop Firefox either (it works on Chromium). Modifying line 507 does not seem to affect anything (and this does not seem to be useful, since there is no cross-origin). I might come to this later.

softwarecreations commented 2 years ago

This issue was closed, but what was the outcome?

By the way I've started using Kiwi Browser (open source Android Chromium browser) with TamperMonkey. I don't like to support Chromium over FireFox, or TamperMonkey over FireMonkey, but have no choice until FireMonkey works on Android FireFox.

erosman commented 2 years ago

This issue was closed, but what was the outcome?

FireMonkey currently runs on Android but there would obviously be issues since I don't have an Android development environment. I depend on user feedback to fix issues on Android.

Iey4iej3 commented 2 years ago

This issue was closed, but what was the outcome?

By the way I've started using Kiwi Browser (open source Android Chromium browser) with TamperMonkey. I don't like to support Chromium over FireFox, or TamperMonkey over FireMonkey, but have no choice until FireMonkey works on Android FireFox.

I am using it on Fennec F-Droid and it seems to work. I don't see any extra issue than the desktop version.

linsui commented 1 year ago

It seems 2.63 has some problems on Android. The scripts can't be injected automatically but I can use Run to inject it.

erosman commented 1 year ago

Oops.. there is copy/paste typo error Fixed in v2.64 v2.64 uploaded

linsui commented 1 year ago

Thanks, waiting for update!