-
Notifications
You must be signed in to change notification settings - Fork 60
black theme not working #31
Comments
Did it work before 1.8.0? |
never did in fact :) Stéphane Bérubé Date: Sat, 5 Sep 2015 09:34:58 -0700 Did it work before 1.8.0? — |
It's something probably wrong in here - https://github.com/indywidualny/FaceSlim/blob/master/app/src/main/java/org/indywidualni/fblite/MyAppWebViewClient.java#L74 If someone could help me a little it would be great. I have no idea, everything is working for me. |
@indywidualny I've no idea how Android coding works. However I assume you scrape the CSS from m.facebook.com then change it. Could their CSS have changed? |
It's possible they have changed something but not the whole of their style sheet. I'm using javascript to inject my own css after every page is loaded. It's read from a file and IMHO the problem is just reading file to string, in this particular case. However it's strange because black css is working on all my devices and nobody complained until now. |
hi, it also doesn't work on my tablet (android 4.2.2). could it be related to lanfuage? i'm using the french translation. Envoyé depuis un mobile Samsung -------- Message d'origine -------- It's possible they have changed something but not the whole of their style sheet. I'm using javascript to inject my own css after every page is loaded. It's read from a file and IMHO the problem is just reading file to string, in this particular case. However it's strange because black css is working on all my devices and nobody complained until now. — |
Language is not a problem for sure. wt., 8 wrz 2015, 12:17 Stephane B. użytkownik notifications@github.com
|
Karbonn Titanium Octane with Android 4.4.x , FaceSlim 1.8.0 from F-droid here. It just worked for me, |
Android 4.2.2 here, doesn't work either. I know how to code, so I can help you with testing/debugging if needed. I haven't looked at the source code yet, so I don't know, but would a logCat help you in any way to determine what's wrong? I'm using the latest version from F-Droid (2.0.0), but previous versions also didn't use the dark theme for display, even though it was enabled in the settings. |
Have a look please. It's extremely simple. After the page is loaded Java Script function is invoked to inject CSS read from a file:
Reading from file (method call):
The main method (really simple) reading the file:
I have no idea where something is wrong. I will add some log lines to it soon to make it easier to debug. |
I don't see anything wrong with your code either. If you have a version with debug logging, I'd be happy to try it and post the logcat output. I've started the application two times, once with the dark theme enabled and once with the dark theme disabled. I/BufferQueue( 130): [org.indywidualni.fblite/org.indywidualni.fblite.MainActivity](this:0x41e63050,api:1) [release] fps:23.83, dur:1007.23, max:230.73, min:15.32 I/SurfaceTextureClient(13430): [STC::queueBuffer] (this:0x60ed18e8) fps:39.65, dur:1008.94, max:426.31, min:3.13 I/BufferQueue(13430): [unnamed-13430-0](this:0x60ed4008,api:2) [queue] fps:39.64, dur:1008.96, max:426.51, min:3.08 I/BufferQueue( 130): [org.indywidualni.fblite/org.indywidualni.fblite.MainActivity](this:0x41de31e0,api:1) disconnect: api=1 I/SurfaceTexture( 130): [org.indywidualni.fblite/org.indywidualni.fblite.MainActivity] [virtual android::status_t android::SurfaceTexture::forceAuxConversionLocked()] mCurrentTexture:0, mCurrentBuf:0x41e0e290 I/BufferQueue( 130): [org.indywidualni.fblite/org.indywidualni.fblite.MainActivity](this:0x41de31e0,api:0) getReleasedBuffers: returning mask 0xffffffff I/SurfaceTexture( 130): [org.indywidualni.fblite/org.indywidualni.fblite.MainActivity](this:0x41ec3bf0,api:0) destroying EGLImage dpy=0x1 img=0x41c94f90 I/WindowManager( 559): Gaining focus: Window{41ecb338 u0 org.indywidualni.fblite/org.indywidualni.fblite.MainActivity} I/WindowManager( 559): Losing focus: Window{41dad150 u0 org.indywidualni.fblite/org.indywidualni.fblite.MainActivity} E/Web Console(13430): Uncaught SyntaxError: Unexpected token ILLEGAL at null:1 I/BufferQueue( 130): [org.indywidualni.fblite/org.indywidualni.fblite.MainActivity](this:0x41de31e0,api:0) consumerDisconnect I/BufferQueue( 130): [org.indywidualni.fblite/org.indywidualni.fblite.MainActivity](this:0x41de31e0,api:0) ~BufferQueue That error is not there in the logcat when running with the dark theme disabled. I hope this helps you to narrow down the problem. |
Apparently everything is ok with the code. The error is caused by illegal characters in the CSS file. Great news, it's so easy to fix! |
That's good news :) What illegal characters are you talking about? The CSS file is ASCII text. Do you mean there are syntax errors in your CSS? It's interesting how Android <=4.2.2 doesn't work and more recent versions do work. Maybe the WebView widget was changed to be more forgiving in later versions of Android? |
I copied some parts of the CSS file from a few sources, maybe something is illegal, some non printable characters... It shouldn't be but... No idea for now. The file is the problem for sure. The file is used to create this JS function. I remember a similar error when there was a syntax error in another JS function. One thing is strange for sure. Why is it working for newer Android versions? :D |
The latest version at this moment (https://github.com/indywidualny/FaceSlim/blob/f479edc507041bc0bcca8d356d750420c5e0a239/app/src/main/res/raw/black.css) has no strange characters. I'll see if I can persuade |
New lines seem to be a problem here - http://stackoverflow.com/a/12702807/4388718 This line has to be removed:
I will do so and send you a fixed package to test it. |
Either remove that line or change https://github.com/indywidualny/FaceSlim/blob/master/app/src/main/java/org/indywidualni/fblite/MyAppWebViewClient.java#L83 so it wraps Anyway, I'd be glad to test a fixed package and report success/failure. |
Try this please: I hope everything is ok now. |
It works! :D |
Awesome! Thanks for help. I wouldn't do anything without your logs. |
with latest version on android 4.1.2. do you need more information?
The text was updated successfully, but these errors were encountered: