face-hh / webx

An alternative for the World Wide Web - browse websites such as buss://yippie.rizz made in HTML, CSS and Lua. Custom web browser, custom HTML rendering engine, custom search engine, and more.
Apache License 2.0
1.86k stars 152 forks source link

CSS bugs & some feature requests #108

Open Optic-the-Wolf opened 5 months ago

Optic-the-Wolf commented 5 months ago

I'm not sure if these are Windows-exclusive, but on WebX, I've been experiencing the following issues:

Additionally, I kindly request that the following could be implemented to WebX, as they will benefit everyone:

Not-Alaska-Airlines commented 5 months ago

I'm not sure if these are Windows-exclusive, but on WebX, I've been experiencing the following issues:

  • Adding an & (ampersand) to a tag resets its styling.
  • <a> tags cannot be stylized.

Additionally, I kindly request that the following could be implemented to WebX, as they will benefit everyone:

  • Sandboxing Lua code! This is important!
  • Support for images on Windows prebuilt binaries
  • Browser tabs
  • An equivalent of JavaScript's elem.innerHTML and doing elem.style.display = "none"
  • A wait/pause/sleep function (e.g. JS's setTimeout)

I have two comments to make on this, firstly, Windows, did, have support for images, but it broke for some reason. And also, no wait can be done because Lua runs on the same thread as the interface, so if you make something wait, it just takes that much longer for the webpage to load.

GStudiosX2 commented 5 months ago

I'm not sure if these are Windows-exclusive, but on WebX, I've been experiencing the following issues:

  • Adding an & (ampersand) to a tag resets its styling.
  • <a> tags cannot be stylized.

Additionally, I kindly request that the following could be implemented to WebX, as they will benefit everyone:

  • Sandboxing Lua code! This is important!
  • Support for images on Windows prebuilt binaries
  • Browser tabs
  • An equivalent of JavaScript's elem.innerHTML and doing elem.style.display = "none"
  • A wait/pause/sleep function (e.g. JS's setTimeout)

I have two comments to make on this, firstly, Windows, did, have support for images, but it broke for some reason. And also, no wait can be done because Lua runs on the same thread as the interface, so if you make something wait, it just takes that much longer for the webpage to load.

When I was messing with stuff I actually did figure out a way to add a set_timeout it was smth like this

// func is LuaOwnedFunction
// ms is u64
glib::spawn_future_local(async move {
  glib::timeout_future(core::time::Duration::from_millis(ms)).await;
  if let Err(e) = func.call::<_, ()>(()) {
    lualog!("error", format!("error calling function in set_timeout: {}", e));
  }
});

I'm pretty sure I tested it but if it doesn't work then just have to find a different way

face-hh commented 5 months ago

I'm not sure if these are Windows-exclusive, but on WebX, I've been experiencing the following issues:

  • Adding an & (ampersand) to a tag resets its styling.
  • <a> tags cannot be stylized.

Additionally, I kindly request that the following could be implemented to WebX, as they will benefit everyone:

  • Sandboxing Lua code! This is important!
  • Support for images on Windows prebuilt binaries
  • Browser tabs
  • An equivalent of JavaScript's elem.innerHTML and doing elem.style.display = "none"
  • A wait/pause/sleep function (e.g. JS's setTimeout)

I have two comments to make on this, firstly, Windows, did, have support for images, but it broke for some reason. And also, no wait can be done because Lua runs on the same thread as the interface, so if you make something wait, it just takes that much longer for the webpage to load.

When I was messing with stuff I actually did figure out a way to add a set_timeout it was smth like this

// func is LuaOwnedFunction
// ms is u64
glib::spawn_future_local(async move {
  glib::timeout_future(core::time::Duration::from_millis(ms)).await;
  if let Err(e) = func.call::<_, ()>(()) {
    lualog!("error", format!("error calling function in set_timeout: {}", e));
  }
});

I'm pretty sure I tested it but if it doesn't work then just have to find a different way

Yes, I've also been able to add a sleep function but since Lua and GTK run on the same thread, the program had to wait for the Lua code to run before starting altogether.

Setting the timeout via glib seems interesting though, I'll try it out

GStudiosX2 commented 5 months ago

I'm not sure if these are Windows-exclusive, but on WebX, I've been experiencing the following issues:

  • Adding an & (ampersand) to a tag resets its styling.
  • <a> tags cannot be stylized.

Additionally, I kindly request that the following could be implemented to WebX, as they will benefit everyone:

  • Sandboxing Lua code! This is important!
  • Support for images on Windows prebuilt binaries
  • Browser tabs
  • An equivalent of JavaScript's elem.innerHTML and doing elem.style.display = "none" (Essential!)
  • A wait/pause/sleep function (e.g. JS's setTimeout)
  • Subdomains & page urls (Essential!)

121 added set_timout I probably will do elem.set_inner_html next pr

Edit: I have also added style.display = "none" essentially it's elem.set_visible(bool)