bernaferrari / ChangeDetection

Automatically track websites changes on Android in background.
Apache License 2.0
711 stars 99 forks source link

Broken "Open in browser" #13

Closed cioccarellia closed 6 years ago

cioccarellia commented 6 years ago

The webview that should be hosting the new and old page changes doesn't render properly for websites like Google, and it is shown as a little popup, couldn't it be made bigger, or in something like a chrome custom tab, and working with every website?

cioccarellia commented 6 years ago

I started getting more info about this and with other websites it works properly, also with a bigger popup dimension

bernaferrari commented 6 years ago

Hey @AndreaCioccarelli, sorry for the late response. For some reason I didn't see the GitHub notification a week ago.

Yeah, you are right. Since the app is only saving the HTML from a website, not the images, not the javascript, this is what you get. Not a bug, but also not a feature.

As for the size, you are right. Any suggestions? As far as I tried, I CAN'T change the Dialog size (I wanted, but the webview always overwrites the match_parent size with its own). I can make it become a BottomSheet, or full screen like other fragments.

The chrome custom tab only works if I send the URL, I don't think it is able to receive a custom html and render.

cioccarellia commented 6 years ago

Looking for a solution too, I'll let you know when something new is going on 💪

But before digging into the code, I think that the best ideal solution would be, as you said, a BottomSheet (With 0dp corner radius) wrapping a WebView with a bigger height and width.

For the WebView we don't have to preserve the aspect ratio of the display of course, but we can take advantage of more space to make the visual content bigger (for 16:9 displays).

Now I'll start searching for a workaround that will let us able to resize a WebView

What do you think about that?

bernaferrari commented 6 years ago

Google should show pictures now. It will fetch live, so, for obvious reasons, they won't be versioned.

If we manage to fix the webview resizing problem, anything gets easy - even the dialog option is ok, since the resizing also happens with bottom sheet.

bernaferrari commented 6 years ago

Done, please check if it was what you wanted!

cioccarellia commented 6 years ago

Well, in Google it renders the image but on GitHub nothing happens, it is a kind of strange because it seems like the css/js is missing

Sent from my OnePlus5 using FastHub

bernaferrari commented 6 years ago

Try again!

It is really hard to do it right with regex, but I think it will now work with most websites.

cioccarellia commented 6 years ago

Using the latest version (1.2, juat updated)

Google.com

Google is still the same, JavaScript doesn't work because the button cannot be clicked

Github.com

Github works perfectly while before it didn't

Amazon.com

Amazon renders perfectly but it raises another mini problem, we cannot use the keyboard

www.roccocamera.it

A site of a friend of me still doesn't work, I wonder if the problem is in his site or not

Microsoft.com

Microsoft renders correctly execpt for the JavaScript code

I think we are making a lot of progresses but we are still missing something

bernaferrari commented 6 years ago

Since I am adding the website to all relative path url links, if the website wasn't in the format microsoft.com / , it wouldn't work. Fixed!

As of the keyboard (and why you can't scroll horizontally), I have absolutely no idea. This is something from the webview. Also, this is a versioned-non-live version, you probably don't want to write anything to it, you just want to see the differences.