rocksdanister / lively

Free and open-source software that allows users to set animated desktop wallpapers and screensavers powered by WinUI 3.
https://rocksdanister.com/lively
GNU General Public License v3.0
14.87k stars 1.05k forks source link

Add Firefox engine #573

Open jdelaiglesia opened 3 years ago

jdelaiglesia commented 3 years ago

Is your feature request related to a problem? Please describe. I'm trying to make a dynamic wallpaper who shows the local news and some additional info, and because of a bug with the mode: 'no-cors' on fetch() function, i can't do it (you can see the bug here). However, on Firefox, this mode works flawlessly. Also, it has some other graphic advantages and less RAM usage.

Describe the solution you'd like It would be cool to be able to choose between CEF, Edge or Firefox.

Describe alternatives you've considered Maybe some other engine who doesn't depend on chromium, as that bug is present on Edge Chromium, Brave and Chrome (Chromium engine, to be clear)

rocksdanister commented 3 years ago

Adding a new engine is a big task, will need to look into it before deciding if its worth the effort.

For now alternatives: https://www.w3schools.com/xml/xml_http.asp https://github.com/Rob--W/cors-anywhere

jdelaiglesia commented 3 years ago

Adding a new engine is a big task, will look into it.

For now alternatives: https://www.w3schools.com/xml/xml_http.asp https://github.com/Rob--W/cors-anywhere

Hi,

The bug is with no-cors requests, so ANY form of xml/json requesting on servers without cors headers correctly configured will absolutely fail.

dabjulmaros commented 3 years ago

Huh thats interesting. Do you have an example of a server with that behavior?

jdelaiglesia commented 3 years ago

Huh thats interesting. Do you have an example of a server with that behavior?

Sure.

http://91.123.205.100/xml/manager_data.php?sport_id=1&username=olavarriense4ever

dabjulmaros commented 3 years ago

huh thats fun I had never run into that before, and I use chrome.

dabjulmaros commented 3 years ago

So Im no trying to get your hopes up... But I got it to work using jquery and https://cors-anywhere.herokuapp.com/. I got it working on jsfiddle and on my computer... I did had to go to https://cors-anywhere.herokuapp.com/ and click the button that makes you request access to the demo server. Then I just did this

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>noCors</title>
  <script
  src="https://code.jquery.com/jquery-3.6.0.min.js"
  integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
  crossorigin="anonymous"></script>
  <script defer>
    $.get("https://cors-anywhere.herokuapp.com/http://91.123.205.100/xml/manager_data.php?sport_id=1&username=olavarriense4ever", function(data, status){
          console.log(data);
      console.log(data.getElementsByTagName('ManagerZone_UserData'))
      document.body.innerText=data.getElementsByTagName('ManagerZone_UserData')[0].innerHTML;
    });</script>
</head>
<body>
</body>
</html>

And as expected I got this image

dabjulmaros commented 3 years ago

I tested it originaly from a simple http server, but it also works being loaded from a static file image

jdelaiglesia commented 3 years ago

The big problem is, it requires extra configuration. It will work for me, but not for sharing, as it was intended.

dabjulmaros commented 3 years ago

Have you checked using the cors anywhere library? I don't think that one requires extra configuration

jdelaiglesia commented 3 years ago

Have you checked using the cors anywhere library? I don't think that one requires extra configuration

AFAIK it requires setting up a server, so it's not viable. Using https://cors-anywhere.herokuapp.com/ is also not viable because of that 'request access' limitation.

dabjulmaros commented 3 years ago

Why is making the users request access to cors anywhere not viable? 🤔

jdelaiglesia commented 3 years ago

Because it forfeits a bit the purpose of "automatic information".

Anyways, the demo server is running on Heroku, so maybe i can clone it or something.

dabjulmaros commented 3 years ago

Because it forfeits a bit the purpose of "automatic information".

.... Isn't that already out of the window by requiring downloading lively, and the wallpaper? A single click doesn't make a difference in the grand scheme of things.

Also I thought setting up a server wasn't viable XD.

Idk dude, there is absolutely a way of doing it without requiring a whole new browsing engine to get added. Try messing some more with jQuery. Or you may find some other proxy service that is open and free. Good luck.

jdelaiglesia commented 3 years ago

.... Isn't that already out of the window by requiring downloading lively, and the wallpaper? A single click doesn't make a difference in the grand scheme of things.

That's only for the first time, when you can easily follow a tutorial. Constantly clicking a button could be very annoying.

By the way, I solved it cloning 'cors-anywhere' on a Heroku server and deploying it.

Anyways, i think it can be interesting to implement Firefox as an usable engine. It has a lot of advantages, such as less RAM usage and 'better' privacy.