how can I make my desktop application run from a browser? - javascript

I'm trying to make installer button like in visual studio website like there then you click in install it open vscode in your computer and start to install the extension
how is this possible ?.

In the case with vscode the website calls a file type already registered in Windows, it could be docx for a Word document, pdf or whatever. Here it is the file type for extensions in vscode.
If you want the same thing to happen you have to install the application first, register a file type for it with an installer and call a file of that type from the website
Making installers and choosing what type is a bit out of scope for this answer.

Related

How to make a node js an exe file

How do I make my Node JS application an executable file on Windows?
I've been trying to use the module pkg which works ok, but I am wanting to choose the icon myself! I tried to use multiple apps to change the icon, which did change the icon, but the app is not starting anymore and also if the app is executed as an administrator that it says company and my name are not unknown.
I packaged my file using: pkg index.js
If you could help me out it would be awesome!
It's not required to this to function on linux nor on other platforms, but only Windows.
You can change the icons of executables generated with pkg with ResourceHacker. There is even a discussion about it on the GitHub repository of pkg.
In this discussion, a person even wrote a script to automate icon adding while building with pkg.
You may want to look at Electron project

How can I debug stand alone JavaScript files in Visual Studio Community 2015?

I am practicing JavaScript and have some stand-alone JavaScript source code that doesn't have to run inside a Web page.
I opened a New -> File in Visual Studio Community 2015 and pasted my JavaScript code in there and saved it to a file on my disk.
I set breakpoints where I wanted to.
Now, I see the Attach button on the top that looks like the Run button but I don't know process what to attach this code to. How do I run this JavaScript code in debug mode?
This question pertains to using Visual Studio as an editing and debugging environment for JavaScript stand-alone sources.
You certainly can do this with Visual Studio. You have two options:
Use the EXE project system to launch and debug your JavaScript file with cscript.exe (Makes full use of the IDE, but requires some setup)
Use the Just-In-Time debugger to attach Visual Studio to cscript.exe, launching Visual Studio, if necessary. (Gets you debugging with no setup, but does not really make use of the IDE)
Option 1: Using the EXE Project System
You can create a project from an EXE so that you can launch the EXE with F5, F10, or F11. From the File menu, choose Open Project and choose %windir%\System32\cscript.exe and click Ignore on the UAC prompt. You should now have a project named cscript.
Now you can either create or open a .js file for editing and setting breakpoints. To debug your .js file, setup the project properties.
Right-click on the project and select Properties to open the project properties page.
Fill in the following parameters:
Arguments: //D file
Debugger Type: Script
Working Directory: Path to the folder containing your .js file
The remaining parameters' default values should be good enough. At this point, you are ready to hit F5 and debug your .js file.
Option 2: Using the JIT Debugger
You can run your .js file with the following command in the command prompt:
cscript //X <your .js file>.
This should automatically bring up the Just-In-Time debugging dialog from which you can choose which Visual Studio installation/instance to launch and attach with (shown below).

How can I run script.js in Eclipse console?

Is it possible to do the same as this in Eclipse what he is doing in Intellij IDEA? to run the javascript file in console?
To set up Eclipse to run JavaScript files:
In Eclipse, got to Run > External Tools > External Tool Configurations
Double click on Program to open a new configuration and name your new configuration (ex. Node_Config)
Figure out where you have node.js installed. Paste the results in the 'Location' box in Eclipse. (If you haven't installed node, do so here)
Mac: in the command line, run which node.
Windows: in the command line, run where node, or see this for more/different windows advice
Fill in the following:
Working Directory: ${container_loc}
Arguments: ${resource_name}
Click apply, and then close.
Now, in the main Eclipse screen, find the play button with a red toolbox (next to the regular play button). When you have a js file open that you want to run, click this and it will be just like running it from your console using node.
Since Eclipse Neon you can do that. I suggets you that you
download Eclipse Neon and install Eclipse JEE Neon distribution.
install node.js.
With Eclipse JEE Neon, you will benefit with Run As / Node.js Application and even with Debug As / Node.js Application:
He is using WebStorm which is editor for Front-end dev from same company (JetBrains).

Load local files on Chrome-os

I am trying to create a JavaScript pacman game, but whenever I try and load my script files or images, I get the error:
The browser I'm using is chrome, and the files are stored in the same directory. I am running CHROME OS, so I can't just go into files and edit an existing flag.
Same for the images, except the file name is different.
Does anyone know why I am getting an error Access Denied, or how I could test the files?
The files are loaded using this format
<script src="Scripts/gamescript.js"></script>
<body>
<div class="game" id="game">
<img src="/Images/ghosts/red.png" />
</div>
</body>
Per request, here is my file tree
/Javascript_Pacman_Game/
index.html
/Styles/
stylesheet.css
/Scripts/
gamescript.js
myCustomLibrary.js
setInterval.js
/Images/
/Ghosts/
red.png
blue.png
pink.png
orange.png
scared.png
/GameElements/
board.jpg
bloop.png
superBloop.png
The problem isn't spelling or file permissions, and I can't run a local host because of Chrome-OS.
Try installing Web server for Chrome, telling it to serve files from your /Javascript_Pacman_Game folder, and testing your app at http://127.0.0.1:8887/
If you have to handle this from chromium OS (specially with dual boot cloud ready), follow the steps
Step 1:
Go to the shell prompt Ctrl + Alt + T on shell open the chrome_dev.conf
$ sudo vi /etc/chrome_dev.conf
The sudo default password would be 'chrome', The file may be write protected follow these steps incase if you stuck in step 1
$ sudo cp /etc/chrome_dev.conf /usr/local
$ sudo mount --bind /usr/local/chrome_dev.conf /etc/chrome_dev.conf
$ sudo vi /etc/chrome_dev.conf
Step 2:
Once you open up the file write --allow-file-access-from-files on top of the file
Step 3:
Restart the UI (if you are using windows dual boot press CTRL + ALT + F2) from dev shell
$ sudo restart ui
Once its restart the changes will get affect in chromium OS chrome, to check type chrome://gpu on your chrome browser
Under command line Argument you can find argument options.
You really should be running a local server. Apache, IIS, etc. Than you can run off localhost and have no issues.
BUT if you really want to run off the file system, you need to start up chrome to allow it.
You need to set --allow-file-access-from-files
http://www.chrome-allow-file-access-from-file.com/
It sounds like your permissions have been edited (or defaulted) to restrict your current user from accessing those files.
I managed to reproduce this error by creating the same file structure you have and then
right clicking red.png > properties > security > edit...
then denying access to this file from my current user. It seems that if you deny access via the directory you get a File not found error instead since the browser isn't even able to navigate to the directory in the first place.
Try checking your individual file permissions. If this is a default file permissions issue you may want to ask about how to fix that on a different forum.
The error is from your spelling, the first one you said
gamescript.js
and you called it as
script src="Scripts/gamscript.js"></script>
Check your spelling, you did not include "e"
Use Chrome Dev Editor as your IDE, then you can just hit the run button in the top left.
You could also use this Server.
javascript doesn't have access to the filesystem of a computer for security reasons do
<script src="Scripts/gamescript.js"></script>

Eclipse does not support web projects or web file types after installing WTP. Am I installing it incorrectly?

I currently have the latest version of Eclipse (Juno) and I have installed ADT with no problem. I have moved on to a web based project and I require support for JavaScript and HTML etc. I installed WTP through the update manager and you can see that all of the required packages appear to be installed:
However, within Eclipse there is very little evidence that anything has been installed. I have read in this jsdt tutorial that I should be able to create web projects such as "Static Web Project" and have text editting support for HTML and JavaScript. However, I see no web project options, HTML or JavaScript file options, no perspective options for HTML or JavaScript, and no support for editing html/javascript files.
Here you can see an html file I attempted to create. Notice the lack of syntax colouring:
Here you can also see all the project creation options that are available to me:
So how should I have installed WTP? Should I not have installed it thought Eclipse's software manager? I would like to do this without having to re-install Eclipse if possible.
This problem seems to exclusively occur in Windows 7. I managed to successfully install the desired software by right clicking on the Eclipse icon, selecting "Run As Administrator" and then re-installing all packages. I did not have to do this in Windows Vista.
If you are experiencing this problem and you are using Windows then follow these steps.
Right click on the Eclipse icon and select Run As Administrator.
Once you have opened your Workspace go to Help -> Install New Software.
Any installed packages that you installed when you did not Run As Administrator should now not appear to be installed. So install them again.
Restart eclipse (normally if you wish) and your desired packages should be installed correctly.

Categories

Resources