This question is pretty short and self explanatory. I'm wondering how I can run my Chrome extension in NW.js.
I know you can run an app in NW.js and I think you can run extensions as well?
I can't find much on the topic. Back in 2013 the way to do it seemed to be:
nw [path to manifest.json] --load-extension
Any ideas are appreciated!
Yes you can.
First off, download the extension you want. For this example I'll be using this debugging tool, which adds an additional tab in the dev tools window.
Inside your NW.js package.json file, ensure you have an entry called chromium-args.
Ensure its value contains --enable-extensions --load-extension=relative_path_to_extension_manifest.
My package.json looks like this:
After restarting the application, the extension shows up as expected:
Something I'll add is that the full Chrome API might not be available to you. I couldn't find info about what NW.js supports, but Electron definitely does not support the entire API, so this might have similar restrictions.
I also noticed you mention in the comments that you need to assign a hotkey of sorts. I'd need to know what you were trying to do, but essentially you have the option of either using a browser mechanism such as addEventListener('keydown', myHandler) or using the NW.js API depending on your exact needs.
Related
I am trying to implement remote desktop server using libvnc, I have downloaded the libvnc and build the library and able to run sample code. And in the example code I can see the function rfbGetScreen http://libvnc.github.io/doc/html/libvncserver_doc.html which display plain background not the desktop. Does that mean I have to find some other library to get desktop and share using vnc, or vnc has some inbuilt function to do this.
it does seem so. You need to put into rfbScreenInfoPtr::framebuffer screenshots. I've never saw any inbuilt functions yet. May be I've poorly searched.
Try SDL2. May be it will help.
We have a list of browsers we test our webapp in. I have a task to notify the user if his browser isn't supported or tested to work well with our app.
We have a browserslist configuration in the project and I'm looking for a way to test current browser against the list.
I tried browserlist-useragent but we can't compile it with webpack due to the fact it uses net, fs, tls and other native node modules we don't want to include in our bundle.
Is there any better way do avoid copying the list of supported browsers in many different places and just use browserlist configuration that already exists to detect if user uses supported one or not?
I'd consider using this "utility" package https://github.com/browserslist/browserslist-useragent-regexp in the project that uses browserslist, and then use the file generated by the script suggested by this package to then use anywhere else.
In reality, all you want is the regex in the generated file. This can be placed in any client or server code you need for browser detection. I've placed mine in some classic asp.
Also note that on a Windows PC, the instructions provided don't result in a file containing a RegEx. Instead, you'd need to run npx browserslist-useragent-regexp --allowHigherVersions to display a suitable RegEx on your console, and then add that where needed.
to gain more experience coding and support good projects, I recently got into open source projects and Github. After looking for a project I would like to work on, I found Soundnode (https://github.com/Soundnode/soundnode-app). The project uses NW.js, Node.js and Angular.js.
The question is very fundamental: How do I run the NW.js desktop app from the given files?
I was able to compile the app once, using the bash command open -n -a nwjs --args "/Users/example/path/app". But how do I compile the changes? After changing the index.html file, which is the start for the application, I have to terminate the NW.js app and start it up again (otherwise nothing will happen) and then it opens again the same, unchanged, original app (I changed some html text to see if would load the changed index.html).
Could anyone give me a quick guide how to work with this? What I want to change and everything else I will try to figure out on my own. Just need somebody to give me a head start :)
Best Regards, bbrinx - eager to learn.
nwjs application works next ways:
direct load web files from FS or web
archive files to zip package.nw
Check nwjs manual and docs: http://docs.nwjs.io/en/latest/ and https://github.com/nwjs/nw.js/wiki
Easiest way to compile your app is to use Web2Exe. It can compile for Win, Mac, Linux.
You can use browser tools for developing/debugging your application. Set toolbar option in true in window section in package.json file to see browser elements in your app.
I'm planing to make a web app which will allow you to have a Linux Terminal on a web page so that you can execute any command an get the response as if you were in front of your linux terminal.
I planed to use NodeJS as it is server side JavaScript, asynchronous and fast.
Also I saw this wich does exactly what i'm trying to do, I peeked in the source code, but didn't found something useful, I also analysed it with google chrome developer tools on the network tab, but there is absolutely nothing even while executing some commands and getting responses. How is this possible ? what technology do you think they used ?
So I wanted to get your advice, your experience in order to start it the right way.
I firstly decided to use NodeJS, but if there is another programming language or Framework more appropriate for this kind of application please let me know.
If you want a real terminal in the browser using node.js on the backend, you might give tty.js a try.
Alternatively you can use the pty.js module manually which is used by tty.js. Along with that, you could also use xterm for doing the browser-side terminal emulation.
Quick question: Is it possible to use Adobe Brackets to debug Node.js using Node-inspector. Like be able to step debug in Adobe Brackets?
Thanks
Regards
Chris
There's a Brackets extension for "Live Development" with Node.js:
https://github.com/DennisKehrig/brackets-v8-node-live
And a general JS debugger extension:
https://github.com/jdiehl/brackets-debugger
The problem is they don't work together yet: the debugger assumes you're using the usual Live Development mode, which connects to a Chrome browser instance. The authors of those two extensions collaborate frequently, and I believe at one point they were working on making the extensions compatible (see the "v8bridge" branch in the first extension). I think they'd be pretty responsive if you start a thread in the brackets-dev Google Groups forum with this question.
The Theseus project for Brackets is an 'omniscient debugger' that supports inspecting code that's running in Node.