Code Monkey home page Code Monkey logo

Comments (10)

bitnom avatar bitnom commented on May 12, 2024 1

Wasn't the new Edge built using Chromium as a base? Does it not replace the old IE webview?

edit: I don't quite understand. IE is not Webkit so what does IE have to do with it?

from webgui.

bung87 avatar bung87 commented on May 12, 2024 1

thought appendChild need dom ready, we can simply use onload even there is little different.
I've tested on win11.

#define CSS_INJECT_FUNCTION                                                    \
  "(function(e){window.onload=function(){var "                                                          \
  "t=document.createElement('style'),d=document.head||document."               \
  "getElementsByTagName('head')[0];t.setAttribute('type','text/"               \
  "css'),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document."          \
  "createTextNode(e)),d.appendChild(t)}})"

from webgui.

juancarlospaco avatar juancarlospaco commented on May 12, 2024

It is a known "bug", basically if you target Windows, you have to keep IE compatibility,
theres tools on JavaScript world to compile the JavaScript to older JavaScript compatible with Internet Explorer, like Babel and similar.
Basically of the 3 web engines built in the OS, the Windows one sucks the most.

Honestly I do not know a better way to fix that.
I look for other alternatives and libs to wrap but they tend to use .NET on Windows.
:(

from webgui.

juancarlospaco avatar juancarlospaco commented on May 12, 2024

It does not use Chromium, thats why is more light weight than ElectronJS.
:)

from webgui.

marcomq avatar marcomq commented on May 12, 2024

I got the same error on the blink example, that doesn't even use Javascript in the HTML part.

This error is from 'CSS_INJECT_FUNCTION' in webview.h
It is the only occurance of appendChild that I could find in the code.

I was able to run the example on windows without error message after making some modifications in the webview.h
I changed the webview.h from

#define CSS_INJECT_FUNCTION                                                    \
  "(function(e){var "                                                          \
  "t=document.createElement('style'),d=document.head||document."               \
  "getElementsByTagName('head')[0];t.setAttribute('type','text/"               \
  "css'),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document."          \
  "createTextNode(e)),d.appendChild(t)})"

to

#define CSS_INJECT_FUNCTION                                                    \
  "(function(e){var "                                                          \
  "t=document.createElement('style'),d=document.head||document."               \
  "getElementsByTagName('head')[0];t.setAttribute('type','text/"               \
  "css'),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document."          \
  "createTextNode(e))})"

After this, I needed to force to recompile the example with
nim c -r -f example.nim

However, this isn't any permanent solution.
The "blink" text stopped blinking in the application. So there are now issues with inline css. Maybe also other new CSS issues.

The CSS_INJECT_FUNCTION issue in the Webview.h was also in the original Webview code and was never changed. The code doesn't exists in the current webview main branch, as there were massive changes in March. A complete new webview branch was merged that changed webview.h completely: webview/webview@843c3aa#diff-90d68d8f03ac5ea2a94bf99d53d4b9d0

from webgui.

ThibaudMZN avatar ThibaudMZN commented on May 12, 2024

Did you guys manage to fix this ? I'm having exactly the same problem

from webgui.

bung87 avatar bung87 commented on May 12, 2024

@juancarlospaco I think in newWebView result.css should not be called by default. this project main usage is create crossplatorm web based gui, the end developer will use their own design in common, I also notice jsTemplate use arrow function syntax which is not supported in old IE webview, please alteast make this project usable.

from webgui.

juancarlospaco avatar juancarlospaco commented on May 12, 2024

Pull Request welcome, and will be merged, right now I do not have Windows to test easily.

from webgui.

CardealRusso avatar CardealRusso commented on May 12, 2024

why it was closed? this error stills persist

from webgui.

CardealRusso avatar CardealRusso commented on May 12, 2024

Using run_js example, first i get this error
webgui_error

Using @bung87 will prevent this error but it still (even without the fix) a second error happens:
webgui_error

wich wont fully load the js

webgui_error

from webgui.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.