nw.js

nwjs reactjs, confused about my context. Document is undefined

好久不见. 提交于 2020-01-13 05:59:28
问题 In my nwjs application i am using React to build my UI. Currently, React is being loaded via a <script> tag in the main file, index.html. index.html has another <script> tag which loads main.js containing code which defines and renders my React components as well as requiring ( require() ) a few Node modules such as "fs" and "McFly". This all seems to be working, however when i try using another node module (react-inlinesvg) i get an error, "document is undefined". Having looked online for

2020年前端学习体系与前端概述

為{幸葍}努か 提交于 2020-01-06 18:56:14
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 前端学习目标 基础课程:HTML + CSS javaScript DOM BOM AJAX HTML5 + CSS3 应用课程:jQuery easyUI 移动端开发 响应式开发 PHP基础 H5UI bootstrap less/stylus 模板引擎 swiper iscroll select2 工程课程:ES5/6/7 git&GitHub nodeJS mongoDB mySQL webpack gulp babel VUE 微信小程序 REACT 学习前端所需要用到的工具 欲善其事必先利器,工具花样不在多,重点在人的技术本身。 最简化工具有 chrome浏览器、 editplus编辑器、pxCook量图器。后续随着课程推进,会慢慢介绍各种辅助工具,在这里就罗列,以免干扰新手小白。 浏览器 浏览器是网页的载体,是咱们前端工程师的主战场。浏览器常用的有 IE系列、火狐(FireFox)、谷歌(chrome)、Safari(苹果)、Opera等 浏览器 浏览器市场份额 在2020年,浏览器的霸主地位已经确立,Chrome凭借超简约的界面以及强大的扩展性夺得宝座,当然少不了国内浏览器大量使用chromium内核带来的二次推广的贡献 查看网站 : https://tongji.baidu.com

Embedding Youtube videos not working with Node-webkit

风流意气都作罢 提交于 2019-12-22 18:46:11
问题 I have an embedded youtube video in my nw.js app. The preview for the correct video shows up properly but when I click to play it I am met with the following error: An error occurred, please try again later All of the videos in the app get this error, except for one that gets this puzzling error: The following video contains content from the International Basketball Federation When I click these videos, I can see the first split second of the video before the error shows up. I tried enabling

PythonShell in node (nwjs)

删除回忆录丶 提交于 2019-12-20 15:23:08
问题 I am trying to create a nw.js application that communicates with Python using the node module PythonShell. The issue I am having is that nothing is written to the console unless I close stdin. However I would like to keep the stream open so that I can send multiple commands to the Python script, and have Python save its state. Here are my scripts: script.py import sys def main(): command = sys.stdin.readlines() # unused for now sys.stdout.write("HELLO WORLD") sys.stdout.flush() if __name__ ==

Module version mismatch with headless browser and desktop Node

只谈情不闲聊 提交于 2019-12-19 10:09:20
问题 I'm getting a "Module version mismatch error" when I try to use a headless browser with a desktop Node shell. I've tried Zombiejs and Phantomjs with both nw.js and atom-shell; in both cases as soon as the headless browser comes into play the application crashes with a module mismatch error. Here's the error with Phantomjs and atom-shell: Uncaught Exception: Error: Module version mismatch. Expected 41, got 14. at Error (native) at Object.module.(anonymous function) (ATOM_SHELL_ASAR.js:118:20)

Integration of Ionic framework and nw.js

两盒软妹~` 提交于 2019-12-13 14:25:15
问题 I am going to build a nw.js (node webkit) app for portability (Mac and Windows). As I'd like the app to run on mobile devices (iOS and Android) later, I use Ionic framework. As suggested by Ionic folks, it's better to keep two sets of views, one for Ionic (mobile) and one for nw.js (desktop). Hopefully I can share codes in the controller and factory. So, here is what I do: 1) Create a Ionic skeleton project: ionic start --appname Hello Hello sidemenu cd Hello ionic serve ... quit 2) Create an

How to get started with angular2 in nw.js

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 15:49:53
问题 How can I get a working 'hello world' for angular 2 under nw.js? I successfully got a working angular 2 app using this guide: https://angular.io/docs/js/latest/quickstart.html and a working nw.js app using this one: https://egghead.io/lessons/javascript-your-first-nw-js-desktop-application-in-less-than-5-minutes Combining the two I get this: package.json : { "name": "angular2-quickstart", "version": "1.0.0", "license": "ISC", "dependencies": { "angular2": "2.0.0-beta.0", "systemjs": "0.19.6",

How to get the current directory for an nw.js executable

佐手、 提交于 2019-12-12 04:21:57
问题 Struggling to find the current directory when I create an nw.js executable. I have created a Mac server application with a mix of html and Javascript and a lot of node.js module usage. I have two xml files that the server accesses and that reside in the same folder as the application. When I run the application as follows: ./nwjs.app/Contents/MacOS/nwjs . and find the current directory as follows: var workingFolder = process.cwd(); then my working folder is the one where the application and

Debug node modules in nwjs

偶尔善良 提交于 2019-12-12 03:33:19
问题 We're developing an application based on node webkit (nwjs) that is a mix of node modules and angular code. A lot of business logic has been moved to the node modules and I haven't found a way to debug that code in the running application. Debugging with devtools doesn't seem to work, and that's a known limitation or bug (Debugging with devtools). I even tried to require node-monkey from one of the scripts, hoping to be able to open some sort of backdoor ;) - didn't work unfortunately. So is

Unable to build nw.js hello world application

坚强是说给别人听的谎言 提交于 2019-12-11 15:47:47
问题 Myself trying to build a hello world application for Linux using nw-builder. It runs when I execute the run command nwbuild -r /path/to/myapp but when i am trying to build it for linux version it gives the following error. { [Error: ENOENT, no such file or directory '/usr/local/lib/node_modules/nw-builder/cache/0.13.0-beta4/linux32/nw.pak'] errno: 34, code: 'ENOENT', path: '/usr/local/lib/node_modules/nw-builder/cache/0.13.0-beta4/linux32/nw.pak', syscall: 'lstat' } When I checking the path