Giter Club home page Giter Club logo

nodegui-plugin-webview's Introduction

NodeGui

All Contributors JS Party #96 Build and Test status Discuss on GitHub

Build performant, native and cross-platform desktop applications with Node.js and CSS like styling.🚀

NodeGUI is powered by Qt6 💚 which makes it CPU and memory efficient as compared to other chromium based solutions like Electron.

If you are looking for React based version, check out: React NodeGUI.

If you are looking for Vue based version, check out: Vue NodeGUI.

If you are looking for Svelte based version, check out: Svelte NodeGUI

Visit https://nodegui.github.io/nodegui for docs.

logo

How does it look?

demo_linux demo_win demo_mac
kitchendemo_macdemo_win

Code Examples

https://github.com/nodegui/examples


Features

  • 🧬 Cross platform. Works on major Linux flavours, Windows, and MacOS.
  • 📉 Low CPU and memory footprint. Current CPU stays at 0% on idle and memory usage is under 20MB for a Hello World program.
  • 💅 Styling with CSS (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga).
  • Complete Nodejs API support (Currently runs on Node v16.x - and is easily upgradable). Hence has access to all Nodejs compatible NPM modules.
  • 🎪 Native widget event listener support. Supports all events available from Qt / NodeJs.
  • 💸 Can be used for Commercial applications.
  • 🕵️‍♂️ Good Devtools support.
  • 📚 Good documentation and website.
  • 🧙‍♂️ Good documentation for contributors.
  • 🦹🏻‍♀️ Good support for dark mode (Thanks to Qt).
  • 🏅First class Typescript support. (Works on regular JS projects too 😉).

Getting Started

Installation

To install latest stable release:

npm install @nodegui/nodegui

To install the latest version available on master branch:

npm install https://github.com/nodegui/nodegui/releases/download/v0.0.0-latest-master/nodegui-master.tgz

or a shorter version:

npm i http://master-release.nodegui.org

If the installation fails to download the Qt binaries, a mirror can be used by setting the following environment variable and running the install command again:

QT_LINK_MIRROR=<alternative domain> # eg. QT_LINK_MIRROR=https://qt-mirror.dannhauer.de

npm install @nodegui/nodegui

See FAQs for more details.

Community guides

Talks/Podcasts

Docs for contributing

It is easier than you think, try it

Looking to contribute? If you wish to implement a new widget/add more features and need help understanding the codebase, you can start here: Contributing developer docs.

Please read https://github.com/nodegui/.github/blob/master/CONTRIBUTING.md

Building from source

This section is useful for those wanting to work on NodeGui itself.

Required tooling

NodeGui requires CMake and Compilation Tools as it is a wrapper for a native C++ widget toolkit QT. Detailed instructions here: https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/

TL;DR:

MacOS

brew install cmake
brew install make

Windows

https://cmake.org/download/

Linux (Debian/Ubuntu)

sudo apt-get install pkg-config build-essential
sudo apt-get install cmake make
sudo apt-get install mesa-common-dev libglu1-mesa-dev

Linux (Fedora/RHEL/CentOS)

sudo dnf groupinstall "Development Tools" "Development Libraries"
sudo dnf groupinstall "C Development Tools and Libraries"
sudo dnf install mesa-libGL mesa-libGL-devel

Building

Once you have cloned this git repository, run this to build:

npm install
npm run build

The last step will takes some time to run as it builds the C++ binaries at the core of NodeGui.

Using your own custom Qt installation (Optional)

Compiling Qt from source

You will need to download and install Qt from source since there are no binaries from Qt for M1 yet.

(https://www.reddit.com/r/QtFramework/comments/ll58wg/how_to_build_qt_creator_for_macos_arm64_a_guide/)

git clone git://code.qt.io/qt/qt5.git qt6
cd qt6
git checkout 6.6

./init-repository --module-subset=essential -f
git submodule init qtsvg
git submodule update qtsvg

cd ..
mkdir qt6-6.6-macOS-release
cd qt6-6.6-macOS-release

../qt6/configure -release QMAKE_APPLE_DEVICE_ARCHS=arm64 -opensource -confirm-license -nomake examples -nomake tests -skip qt3d -skip webengine -skip qtactiveqt -skip qtcanvas3d  -skip qtdeclarative -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtcharts -skip qtgraphicaleffects -skip qtlocation  -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtscript

make -j15

make install

This should install Qt into something like this /usr/local/Qt-6.6.0 (your directory can change. This will be displayed when running make)

Pointing nodegui to use your custom Qt installation

Now just set export QT_INSTALL_DIR=<your qt path> . In the above example it would look something like this export QT_INSTALL_DIR=/usr/local/Qt-6.6.0. Add this in your .zshrc or .bashrc so that you dont need to repeat this process again.

Now just rm -rf node_modules and do npm install again.

The logs should say something like CustomQt detected at <your qt path>. Hence, skipping Mini Qt installation.

Running example programs

A number of small programs to show different parts of the Qt API are in src/examples. They can be run directly with:

npm run qode dist/examples/modelview_1_readonly.js

Updating docs

npm run docs

then followed by:

cd website && GIT_USER=<your_git_username> yarn deploy

Funding

NodeGui is an open source project and requires your support. If you like this project, please consider supporting my work by clicking on the Sponsor button on this Github repository or via Ko-Fi. Alternatively, Issues on NodeGui can be funded by anyone via Issuehunt and the amount will be distributed to respective contributors.

Buy Me a Coffee at ko-fi.com    issuehunt

Special Thanks

Code of Conduct

https://github.com/nodegui/.github/blob/master/CODE_OF_CONDUCT.md

License

MIT

Backers 🚀

Thanks goes to these wonderful people.

Yuriy Yazlovytskyy
Yuriy Yazlovytskyy
John Susek
John Susek
Marc Dijoux
Marc Dijoux
Stephen Belanger
Stephen Belanger
Rustam
Rustam

Maintainers ✨

People maintaining this project.

Atul R
Atul R
Simon Edwards
Simon Edwards

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Lucas Ramage

📖

Denis Sikuler

📖

Nahuel José

💬

Kakul Gupta

💻

Rahul Gaba

💻

Paweł Borecki

💻

Marcus S. Abildskov

⚠️

Átila Camurça Alves

📖

James Hibbard

💻

Soonwoo Hong

💻

Roy Sommer

💻

Paulo Coghi

🤔

Balthild Ires

💻

Dimitar Nestorov

💻

Mikko Sairio

💻

Pepijn

💻

slidinghotdog

💻

Bundyo (Kamen Bundev)

💻

feng8848

💻

Maksim Karelov

💻

mspencer92

💻

blncd2020

📖

gluaxspeed

💻

Solant

💻

Shubham Zanwar

💻

Singha360

💻

Mihkel

💻

Stephen A

💻

流君酱

💻

Adam Gastineau

💻

swittk

💻

craftingmod

💻

Doug Barbieri

💻

HENRIQUE DE SOUZA NERY

💻

Ruslan Garifullin

💻

Ranieri

💻 📖

Nathanael Anderson

💻

Ross

💻 📖

4h7l

💻

Maks

💻

zhb124404

📖

Wyatt Kirby

💻

Steven Koch

💻

Simon Edwards

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

nodegui-plugin-webview's People

Contributors

a7ul avatar jardenliu avatar leonardotessaroalves avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nodegui-plugin-webview's Issues

Installation issue on Windows

I tried to install the webview on my Windows 10 machine but i ran multiple times into the following issue. I tried to install this on the starter project.

``` $ npm install nodegui-plugin-webview
> [email protected] postinstall D:\projects\test\node_modules\nodegui-plugin-webview
> node ./scripts/install.js && npm run build:addon

Minimal Qt 5.14.1 setup:
Skipping setup for Qt Declarative for Minimal Qt: 5.14.1 installation...
Skipping setup for Qt WebEngine for Minimal Qt: 5.14.1 installation...
Skipping setup for Qt WebChannel for Minimal Qt: 5.14.1 installation...
Skipping setup for Qt Location for Minimal Qt: 5.14.1 installation...

> [email protected] build:addon D:\projects\test\node_modules\nodegui-plugin-webview
> cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile

[
'C:\\Program Files\\nodejs\\node.exe',
'D:\\projects\\test\\node_modules\\nodegui-plugin-webview\\node_modules\\cmake-js\\bin\\cmake-js',
'compile'
]
info TOOL Using Visual Studio 16 2019 generator.
info CMD CONFIGURE
info RUN cmake "D:\projects\test\node_modules\nodegui-plugin-webview" --no-warn-unused-cli -G"Visual Studio 16 2019" -DCMAKE_JS_VERSION="5.3.2" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_RUNTIME_OUTPUT_DIRECTORY="D:\projects\test\node_modules\nodegui-plugin-webview\build" -DCMAKE_JS_INC="C:\Users\myUsername\.cmake-js\node-x64\v12.16.2\include\node;D:\projects\test\node_modules\nan" -DCMAKE_JS_SRC="D:/projects/test/node_modules/nodegui-plugin-webview/node_modules/cmake-js/lib/cpp/win_delay_load_hook.cc" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="12.16.2" -DNODE_ARCH="x64" -DCMAKE_JS_LIB="C:\Users\myUsername\.cmake-js\node-x64\v12.16.2\win-x64\node.lib" -DCMAKE_SHARED_LINKER_FLAGS="/DELAYLOAD:NODE.EXE"
Not searching for unused variables given on the command line.
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
-- The C compiler identification is MSVC 19.23.28106.4
-- The CXX compiler identification is MSVC 19.23.28106.4
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using QT installation for nodegui_plugin_webview_init QT_CMAKE_HOME_DIR:D:\projects\test\node_modules\@nodegui\nodegui\miniqt\5.14.1\msvc2017_64\lib\cmake\Qt5
-- Using QT installation for nodegui_plugin_webview QT_CMAKE_HOME_DIR:D:\projects\test\node_modules\@nodegui\nodegui\miniqt\5.14.1\msvc2017_64\lib\cmake\Qt5
-- Using QT installation for nodegui_plugin_webview QT_CMAKE_HOME_DIR:D:\projects\test\node_modules\@nodegui\nodegui\miniqt\5.14.1\msvc2017_64\lib\cmake\Qt5
-- Configuring done
-- Generating done
-- Build files have been written to: D:/projects/test/node_modules/nodegui-plugin-webview/build
info CMD BUILD
info RUN cmake --build "D:\projects\test\node_modules\nodegui-plugin-webview\build" --config Release
Microsoft (R)-Build-Engine, Version 16.3.2+e481bbf88 für .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

Checking Build System
Automatic MOC and UIC for target nodegui_plugin_webview
Automatic MOC and UIC for target nodegui_plugin_webview_init
Building Custom Rule D:/projects/test/node_modules/nodegui-plugin-webview/CMakeLists.txt
mocs_compilation.cpp
win_delay_load_hook.cc
Building Custom Rule D:/projects/test/node_modules/nodegui-plugin-webview/CMakeLists.txt
init.cpp
mocs_compilation.cpp
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(59,1): warning C4273: "NWebChannel::qt_static_metacall": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src/cpp/QWebChannel/nwebchannel.hpp(11,3): message : Siehe vorherige Definition von "qt_static_metacall" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(66,70): warning C4273: "staticMetaObject": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src/cpp/QWebChannel/nwebchannel.hpp(11,3): message : Siehe vorherige Definition von "public: static QMetaObject const NWebChannel::staticMetaObject" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(66,70): error C2491: "NWebChannel::staticMetaObject": Definition von Statisches Datenmember für dllimport nicht zulässig [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(77,1): warning C4273: "NWebChannel::metaObject": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src/cpp/QWebChannel/nwebchannel.hpp(11,3): message : Siehe vorherige Definition von "metaObject" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(82,1): warning C4273: "NWebChannel::qt_metacast": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src/cpp/QWebChannel/nwebchannel.hpp(11,3): message : Siehe vorherige Definition von "qt_metacast" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(92,1): warning C4273: "NWebChannel::qt_metacall": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
win_delay_load_hook.cc
main.cpp
qwebengineview_wrap.cpp
Code wird generiert...
    Bibliothek "D:/projects/test/node_modules/nodegui-plugin-webview/build/Release/nodegui_plugin_webview_init.lib" und Objekt "D:/projects/test/node_modules/nodegui-plugin-webview/build/Release/nodegui_plugin_webview_init.exp" werden erstellt.
nodegui_plugin_webview_init.vcxproj -> D:\projects\test\node_modules\nodegui-plugin-webview\build\Release\nodegui_plugin_webview_init.node
qwebenginesettings_wrap.cpp
qwebenginepage_wrap.cpp
qwebchannel_wrap.cpp
D:\projects\test\node_modules\nodegui-plugin-webview\src/cpp/QWebChannel/nwebchannel.hpp(11,3): message : Siehe vorherige Definition von "qt_metacall" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(10,53): warning C4273: "constructor": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(17,34): message : Siehe vorherige Definition von "public: static Napi::FunctionReference QWebChannelWrap::constructor" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(10,53): error C2491: "QWebChannelWrap::constructor": Definition von Statisches Datenmember für dllimport nicht zulässig [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(12,73): warning C4273: "QWebChannelWrap::init": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(18,23): message : Siehe vorherige Definition von "init" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(26,5): warning C4273: "QWebChannelWrap::QWebChannelWrap": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(19,3): message : Siehe vorherige Definition von "{ctor}" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(46,37): warning C4273: "QWebChannelWrap::~QWebChannelWrap": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(20,4): message : Siehe vorherige Definition von "{dtor}" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(48,53): warning C4273: "QWebChannelWrap::getInternalInstance": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(21,16): message : Siehe vorherige Definition von "getInternalInstance" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(50,77): warning C4273: "QWebChannelWrap::registerObject": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(23,15): message : Siehe vorherige Definition von "registerObject" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(65,79): warning C4273: "QWebChannelWrap::deregisterObject": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
Code wird generiert...
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(24,15): message : Siehe vorherige Definition von "deregisterObject" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
info REP Build has been failed, trying to do a full rebuild.
info CMD CLEAN
info RUN cmake -E remove_directory "D:\projects\test\node_modules\nodegui-plugin-webview\build"
info CMD CONFIGURE
info RUN cmake "D:\projects\test\node_modules\nodegui-plugin-webview" --no-warn-unused-cli -G"Visual Studio 16 2019" -DCMAKE_JS_VERSION="5.3.2" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_RUNTIME_OUTPUT_DIRECTORY="D:\projects\test\node_modules\nodegui-plugin-webview\build" -DCMAKE_JS_INC="C:\Users\myUsername\.cmake-js\node-x64\v12.16.2\include\node;D:\projects\test\node_modules\nan" -DCMAKE_JS_SRC="D:/projects/test/node_modules/nodegui-plugin-webview/node_modules/cmake-js/lib/cpp/win_delay_load_hook.cc" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="12.16.2" -DNODE_ARCH="x64" -DCMAKE_JS_LIB="C:\Users\myUsername\.cmake-js\node-x64\v12.16.2\win-x64\node.lib" -DCMAKE_SHARED_LINKER_FLAGS="/DELAYLOAD:NODE.EXE"
Not searching for unused variables given on the command line.
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
-- The C compiler identification is MSVC 19.23.28106.4
-- The CXX compiler identification is MSVC 19.23.28106.4
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using QT installation for nodegui_plugin_webview_init QT_CMAKE_HOME_DIR:D:\projects\test\node_modules\@nodegui\nodegui\miniqt\5.14.1\msvc2017_64\lib\cmake\Qt5
-- Using QT installation for nodegui_plugin_webview QT_CMAKE_HOME_DIR:D:\projects\test\node_modules\@nodegui\nodegui\miniqt\5.14.1\msvc2017_64\lib\cmake\Qt5
-- Using QT installation for nodegui_plugin_webview QT_CMAKE_HOME_DIR:D:\projects\test\node_modules\@nodegui\nodegui\miniqt\5.14.1\msvc2017_64\lib\cmake\Qt5
-- Configuring done
-- Generating done
-- Build files have been written to: D:/projects/test/node_modules/nodegui-plugin-webview/build
info CMD BUILD
info RUN cmake --build "D:\projects\test\node_modules\nodegui-plugin-webview\build" --config Release
Microsoft (R)-Build-Engine, Version 16.3.2+e481bbf88 für .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

Checking Build System
Automatic MOC and UIC for target nodegui_plugin_webview
Automatic MOC and UIC for target nodegui_plugin_webview_init
Building Custom Rule D:/projects/test/node_modules/nodegui-plugin-webview/CMakeLists.txt
mocs_compilation.cpp
win_delay_load_hook.cc
Building Custom Rule D:/projects/test/node_modules/nodegui-plugin-webview/CMakeLists.txt
init.cpp
mocs_compilation.cpp
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(59,1): warning C4273: "NWebChannel::qt_static_metacall": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src/cpp/QWebChannel/nwebchannel.hpp(11,3): message : Siehe vorherige Definition von "qt_static_metacall" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(66,70): warning C4273: "staticMetaObject": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src/cpp/QWebChannel/nwebchannel.hpp(11,3): message : Siehe vorherige Definition von "public: static QMetaObject const NWebChannel::staticMetaObject" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(66,70): error C2491: "NWebChannel::staticMetaObject": Definition von Statisches Datenmember für dllimport nicht zulässig [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(77,1): warning C4273: "NWebChannel::metaObject": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src/cpp/QWebChannel/nwebchannel.hpp(11,3): message : Siehe vorherige Definition von "metaObject" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(82,1): warning C4273: "NWebChannel::qt_metacast": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src/cpp/QWebChannel/nwebchannel.hpp(11,3): message : Siehe vorherige Definition von "qt_metacast" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview_autogen\include_Release\U7NFRDUAAJ/moc_nwebchannel.cpp(92,1): warning C4273: "NWebChannel::qt_metacall": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
win_delay_load_hook.cc
main.cpp
qwebengineview_wrap.cpp
Code wird generiert...
    Bibliothek "D:/projects/test/node_modules/nodegui-plugin-webview/build/Release/nodegui_plugin_webview_init.lib" und Objekt "D:/projects/test/node_modules/nodegui-plugin-webview/build/Release/nodegui_plugin_webview_init.exp" werden erstellt.
nodegui_plugin_webview_init.vcxproj -> D:\projects\test\node_modules\nodegui-plugin-webview\build\Release\nodegui_plugin_webview_init.node
qwebenginesettings_wrap.cpp
qwebenginepage_wrap.cpp
qwebchannel_wrap.cpp
D:\projects\test\node_modules\nodegui-plugin-webview\src/cpp/QWebChannel/nwebchannel.hpp(11,3): message : Siehe vorherige Definition von "qt_metacall" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(10,53): warning C4273: "constructor": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(17,34): message : Siehe vorherige Definition von "public: static Napi::FunctionReference QWebChannelWrap::constructor" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(10,53): error C2491: "QWebChannelWrap::constructor": Definition von Statisches Datenmember für dllimport nicht zulässig [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(12,73): warning C4273: "QWebChannelWrap::init": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(18,23): message : Siehe vorherige Definition von "init" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(26,5): warning C4273: "QWebChannelWrap::QWebChannelWrap": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(19,3): message : Siehe vorherige Definition von "{ctor}" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(46,37): warning C4273: "QWebChannelWrap::~QWebChannelWrap": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(20,4): message : Siehe vorherige Definition von "{dtor}" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(48,53): warning C4273: "QWebChannelWrap::getInternalInstance": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(21,16): message : Siehe vorherige Definition von "getInternalInstance" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(50,77): warning C4273: "QWebChannelWrap::registerObject": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(23,15): message : Siehe vorherige Definition von "registerObject" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.cpp(65,79): warning C4273: "QWebChannelWrap::deregisterObject": Inkonsistente DLL-Bindung. [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
Code wird generiert...
D:\projects\test\node_modules\nodegui-plugin-webview\src\cpp\QWebChannel\qwebchannel_wrap.h(24,15): message : Siehe vorherige Definition von "deregisterObject" [D:\projects\test\node_modules\nodegui-plugin-webview\build\nodegui_plugin_webview.vcxproj]
ERR! OMG Process terminated: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:addon: `cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:addon script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\myUsername\AppData\Roaming\npm-cache\_logs\2020-11-11T01_46_24_343Z-debug.log
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node ./scripts/install.js && npm run build:addon`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\myUsername\AppData\Roaming\npm-cache\_logs\2020-11-11T01_46_24_719Z-debug.log
```

Sorry that the log is in german but the main issue is Build has been failed, trying to do a full rebuild.. The only issue i see is error C2491: "QWebChannelWrap::constructor"

Maybe you @a7ul or @jardenliu have an idea?

Can't add Webview as Widget to Another Layout

For whatever reason the Webview only seems to work in its own window.
Once I try to add the Webview as a widget to the layout of another element, the app no longer launches.

WORKING EXAMPLE (EXAMPLE #1):

import { QWebEngineView, QWebChannel } from "nodegui-plugin-webview";
const webview = new QWebEngineView();
webview.setInlineStyle("align-self:'stretch';");
webview.load("http://google.com");

const channel = new QWebChannel();
webview.page().setWebChannel(channel);

webview.show();
(global as any).wv = webview;

NOT WORKING EXAMPLE (EXAMPLE #2):

import { QWebEngineView, QWebChannel } from "nodegui-plugin-webview";
import {
  QMainWindow,
  QWidget,
  FlexLayout,
  QPushButton
} from "@nodegui/nodegui";

const win = new QMainWindow();
const center = new QWidget();
const webview = new QWebEngineView();
webview.setInlineStyle("align-self:'stretch';");
webview.load("http://google.com");

const channel = new QWebChannel();
webview.page().setWebChannel(channel);

const button = new QPushButton();
button.setText("Hello");

center.setLayout(new FlexLayout());
center.layout?.addWidget(webview);
center.layout?.addWidget(button);
win.setCentralWidget(center);
win.show();
(global as any).win = win;

Example #1 works and the app launches, example #2 produces this error:

  • webpack 5.49.0 compiled successfully in 3012 ms
  • QtWebEngineProcess[14121] : read failed
  • QtWebEngineProcess[14121] : SeatbeltExecServer: failed to read buffer length.

The app starts to launch, then closes immediately.

No sure what is going on.

Webview as a Child/Widget

I would love to use this library for a few apps, which require a Webview along with native ui components/widgets.

The issue is that when you try and use the Webview like any other widget (Button, Text etc...), as a Child/widget the app breaks/crashes.

Why can't the Webview be used as a "Child View" like any other widget?

Even the example/demo (Demo.ts) breaks and shows an error if you try and use the Webview as a child/widget.

It works only if you allow the widget to open in a new window.

WebRTC on CEF not available

Guys,

First off - this (and nodegui generally) is a great piece of work!

I do have a hard requirement to be able to gain the user's permission for mic/camera access. All standard stuff under WebRTC. It looks like this feature is NOT enabled in the app right now.

I see on the Qt Web Engine site, that it is, however, listed as a feature:

https://wiki.qt.io/QtWebEngine/Features

I wonder what your thoughts are on this. I've seen some stackoverflow posts that detail how one might patch it (the Web Engine); but I thought I'd raise it here first.

Another alternative that may be worth looking at - is to use the "native" WebRTC support in Qt - which largely seems to consist of a 'wrapper' around the WebRTC C++ lib.

(that last option might be a nice feature within nodegui core)

AndyM

Issues on linux

@master-atul are u currently working on this? if not at least this might serve as a future reference..
I have some issues trying this on linux, installed Qt5.13.0 and QT_INSTALL_DIR is set

Here are the issues and what i tried:

  • asks for checkIfNativeElement and QUrl

updated nodegui version on package.json

  • asks for libraries

corrected filenames on qtweb.cmake to "${QT_HOME_DIR}/lib/libQt5WebEngine.so" and "${QT_HOME_DIR}/lib/libQt5WebEngineWidgets.so"

  • Qt WebEngine seems to be initialized from a plugin. Please set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute before constructing QGuiApplication.

rebuilt qode adding this line before new QApplication: QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts,true);
then copied to to node_modules/@nodegui/qode/dist/1.0.6

  • QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

copied manually (don't know how to change config files to include in plugin Release)
plugins/xcbglintegrations from gcc_64 to node_modules/@nodegui/qode/dist/1.0.6

  • Could not find QtWebEngineProcess

copied libexec dir

  • after that some errors about resources and translations

copied resources and translations/qtwebengine_locales

now the demo runs without warnings but webview doesn't show (it flashes image from some electron app i have running, not sure if its related) and only logs http://google.com/ Url from webview.

then i copied entire includes and lib folders from gcc_64 to node_modules/@nodegui/qode/dist/1.0.6 and it worked, tried copying only a few different modules but i couldn't figure out what was missing.

this is what it looks like without last step:
ksnip_20191217-203606

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.