stylish-userstyles / stylish

User styles manager for Firefox and other Mozilla software
https://userstyles.org
GNU General Public License v3.0
545 stars 86 forks source link

Can't make script on firefox mobile. #225

Closed andrewpros closed 7 years ago

andrewpros commented 9 years ago

The title says it all, there are no functionality for creating or editing styles on firefox mobile, i would want to make local styles for private use on many websites that don't support responsive layout eg. are not displaying quite well on mobile.

But after installing stylish in fx mobile, there are no options to add styles manually, only online.

JasonBarnabe commented 9 years ago

You really going to tap out CSS on your phone?

andrewpros commented 9 years ago

Yes, if there isn't any other way, to be honest, it installs but it looks like it doesn't work at all, even from userstyle.org installed style.

As for now there isn't any other way to make mobile website responsive on your own. If you have a website that is not mobile friendly, what you do?

Stylish is the only way, but it doesn't work, so i should basically open another issue.

JasonBarnabe commented 9 years ago

If you don't want to post to userstyles.org, you can use Stylish's "Install from URLs" feature. Host it somewhere, give it the URL, and then you're good to go.

myfonj commented 9 years ago

Actually, you don't even need to host it anywhere, you can use dataURI for that (tried on desktop with current stylish and it works well).

Whats amusing, you may use dataURI document for creating those dataURI styles. Here one quick simple one:

data:text/html;charset=utf-8;base64,PCFkb2N0eXBlIEhUTUw+PHRpdGxlPkRhdGFVUkkgQ1NTIG1ha2VyPC90aXRsZT48c3R5bGU+Knt3aWR0aDotbW96LWF2YWlsYWJsZX08L3N0eWxlPjx0ZXh0YXJlYSBhdXRvZm9jdXMgaWQ9dCBzdHlsZT1oZWlnaHQ6OTB2aD48L3RleHRhcmVhPjxidXR0b24gb25jbGljaz0id2luZG93Lm9wZW4oJ2RhdGE6dGV4dC9jc3M7Y2hhcnNldD11dGYtODtiYXNlNjQsJytidG9hKHVuZXNjYXBlKGVuY29kZVVSSUNvbXBvbmVudCh0LnZhbHVlKSkpKSI+RXhwb3J0IGRhdGFVUkkgQ1NTPC9idXR0b24+
andrewpros commented 9 years ago

Thats all nice, but it looks like stylish doesn't work at all on firefox mobile.

JasonBarnabe commented 9 years ago

It does; I use it. Try https://userstyles.org/styles/1/stylish-test-style.

andrewpros commented 9 years ago

Yeah, my bad.

Actually it turn out stylish will not be enough, i have such mobile unfriendly sites, that i need more greasmonkey than stylish.

But for the issue question the dataURI trick seems not working on mobile.

easyaspi314 commented 8 years ago

@JasonBarnabe I have a little something-something that I have been working on. It was a lot of work, but what do you think? It isn't a major change to the code, just a few tweaks here and there.

tmp_2654-screenshot_20160704-0124451821080188 tmp_2654-screenshot_20160704-013818250914863

It isn't perfect, as I can't get the textbox to scroll, and forget about error checking, syntax highlighting, line numbers, autocomplete, or word wrap. :cry:

Hence the disclaimer.

But it would be enough for a quick little style to fix a thing or two. No more crazy zooming. I am still working on styling so it actually looks decent. XUL on FF4A sucks.

juneyourtech commented 7 years ago

@andrewpros Stylish 2.0.7 allows using local styles in Firefox for Android. These can be installed by browsing the local filesystem in Firefox.

If you want to edit styles on mobile with syntax highlighting, you can use VimTouch.

The affected site/page could be up in one tab, and the Stylish styles update UI in another tab. After making changes, save the CSS file, check for styles updates, update, and switch to the tab of the affected page. The changes will be applied on-the-fly.

andrewpros commented 7 years ago

@juneyourtech

Then can you tell me how can i create such style only on phone, without pc, where to put the file, how to name it, how to browse the local filesystem to add it in mobile fx stylish?

There is only "install from URLs option"

juneyourtech commented 7 years ago

@andrewpros This is based on my experience with Android 2.3:

To browse the local filesystem, enter file:/// in the Firefox addressbar, or just /sdcard (should go to /mnt/sdcard). /sdcard is the folder visible to the default Android file manager. There, you can create a home folder, or give it another name. for example, and it would be /sdcard/home or whatever you name it.

You can name your userstyle as sitename.css

The "install from URLs" button works with the local file system, too; use Firefox to browse to the file in the local file system as described above, then copy the file's location in the folder listing (long-tap > copy), or go to the file and copy its location from the address bar. And then paste it via "Install from URLs".

andrewpros commented 7 years ago

@juneyourtech

Thx, probably will work with some tune.

The file:/// is not working in fx (no access), it depends on smartphone model and android config i guess, but /sdcard works and then redirect to the true url on my phone file:///storage/ etc

Then stylish is loading the file, but... i don't see any changes on tested websites, but probably my fault, will test it again and see.

juneyourtech commented 7 years ago

@andrewpros Much depends on which version of Android is in use, and what kind of access is permitted to local storage.

I have it like this: A userstyle is already installed, then the affected site is in one tab, and as I update the local style via Stylish UI in another tab in Firefox, and switch to that other tab showing the affected site, the site design will have updated automatically.

andrewpros commented 7 years ago

@juneyourtech

Yep, finally i get it working, thx.