Installing Firefox plugins issue - javascript

I am trying to install my own firefox plugin. I follow this tutorial. But each time this gives me following error:-
Firefox could not install the file at
file:///home/ubuntu/googbar.xpi
because: Install script not found
-204

That error means that your file doesn't have an install.rdf file. Please note that it needs to be at the top level of the XPI archive. So maybe you made a mistake packing the file and install.rdf landed in a subdirectory. You can check the list of files using unzip -l googbar.xpi command, it should list install.rdf without a directory name before it.

Related

Cannot use import statement outside a module error after export ZIP from CodeSandbox

I've downloaded this Phaser/MatterJS example from Codesandbox (->File ->Export to ZIP).
Running it locally returns this error:
Uncaught SyntaxError: Cannot use import statement outside a module - index.js:1
How to fix this?
What I tried so far:
I've installed all dependencies
Updated to latest NodeJS
Running it with a local server
Just as you have seen yourself the javascript that is written in the files is not something that the browsers understand out of the box, and so errors were thrown your way.
To send js that browsers understand, you need to use a tool like webpack, parcel. already in the project you shared parcel is used.
You have to do the following:
install the dependecies of the probject
in the root dir of the project run npm run start
parcel will bundle the files and then open an html page with the results
unfortunately when i tried this parcel did not work for me, there were errors related to JSON loading, however i have managed to get the game to work, by running npm run build, this will output for you the build files in a folder called dist.
Go to the dist folder, and start a local server there and visit the file it should work, however again for me it did not work. but i noticed that its due to parcel not getting the correct relative path of the bundled js file.
To solve that, open the index.html file in the dist folder, you will find that there is one script there
<script src="/js.d8530414.js"></script>
I had to change that to
<script src="./js.d8530414.js"></script> // because this was the correct file in my file system
After that visit the html file in the dist folder, and the game works fine.
Obviously this way of working is not conveninent, since for each change you want to see you have to build the project again using npm run build. You need to solve the problem of npm run start not working, it could be that this problem never occurs to you if you are on different os than mine. If it happens then i suggest updating parcel and trying again, if problem still persists, then you can look here since issue seems related to phaser wanting the json file as json, while parcel compiling it to javascript object.
index.html:
<script type = "module" src = "./js/index.js">
You have to tell the browser that this js file is a module, then it will change some things on the backside for you to use this. This article is very helpful for getting started with modules.

WebStorm Error: Please specify path to JavaScript file correctly

I am using WebStorm on Windows to work on node.js projects.
Recently, when I open one of my projects that are located on the OneDrive directory I got the 'Error: Please specify path to JavaScript file correctly' when I run a .JS file. However if I move the same project folder to an other directory (Desktop for example) it works correctly.
PS: Nodemon keeps restarting forever when running on the onedrive project.
How can I fix it?
Please see https://youtrack.jetbrains.com/issue/IDEABKL-7619#comment=27-2504574 for possible workaround.
And, if possible, use some VCS for sharing instead of OneDrive, see https://intellij-support.jetbrains.com/hc/articles/206544839.

Visual Studio Code not performing error checking in Javascript

I've tried following these instructions:
https://code.visualstudio.com/Docs/runtimes/nodejs
I am not getting the green/red swiggly lines at all. Is there something I'm missing?
You can also see the same thing in this video:
https://youtu.be/sE8_bTEBlFg?t=1m37s
As far as I know, they're running the default editor. I've tried installing typings and typescript using npm. I've Followed that tutorial to get Javascript intellisense for node.js, but I fail to get either error/warning checking or any type information for node.js modules.
Is there a location the type files should be installed to in order to make them global to every JS project you create in VS Code?
OK, so I managed get get some code suggestions working after reading up online. Without using the whole Typings tools, I acquired node.d.ts (found it on my computer inside C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions) and placed that in my project's directory structure inside the ".vscode" folder. At the top of my .js file I added the following line:
/// <reference path=".vscode/node.d.ts" />
The code seems to be recognized now.
I read up on this tip here: How to Import Intellisense files into vsCode (Visual Studio Code)
If you are using ESLint and you have an .eslint.js file in the project root you also need the eslint dependency installed in the project. Otherwise, if there is a .eslint.js file but the ESLint dependency is not installed Visual Studio Code will report nothing in the editor.
Maybe you didn't use the -g flag to install them globally? Alternately, perhaps it's a missing jsconfig.json file?

Repackage Firefox SDK extensions

First af all, I'm newbie in Firefox SDK, so any small hint can be a great help for me. To modify a FF SDK extension, I unziped the .xpi file and changed one line of a js file and then ziped it again(as .xpi).But it does't work any more.Actually I followed the instruction explained here except there were no jar file in the directory structure of this addon, so I changed .js files directly. The directory structure of the package is as bellow:
/data
/doc
/lib
/node_modules
bootstrap.js
index.js
install.rdf
package.json
Even I tried to unzip and then zip the file again without doing any modification, but It didn't helped to see if it works or not, but it didn't work again. Is there any trick I miss? How should I repackage it?
I found the answer to my question. The directory structure were the same, but as the code is using add-on SDK, xpi should be produced by jpm. So I modified desired js codes and then I used jpm to produce xpi and it works well now.;)

Installing ExtJS

I am new to ExtJS. I tried installing it as per the steps given here.
But I am getting one error while running this command.
sencha create jsb -a http://localhost:8080/helloext/index.html -p app.jsb3
Error msg :
C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\helloext>sencha create jsb -a http://localhost:8080/helloext/index.html -p app.jsb3 'sencha' is not
recognized as an internal or external command, operable program or
batch file.
What is the problem ?
PS : I already done with the prior steps of installing Apache Server and unzipping ExtJS SDK.
Thanks.
Windows is not finding the sencha executable.
Are you sure you downloaded the Sencha Tools SDK? (Current version is 1.2.3beta). The link from that tutorial shows a page with an obvious link to download the ExtJS library, and less obvious link for the Sencha SDK. Try downloading and installing this from here. Then see if typing "sencha" on the command line does something sensible.
I dont have time to reaad te tutorial but I will let you know how I get started using extjs. I download the library and extract the folder. Name the folder extjs. Then in my webroot or whatever you prefer I make a directory called lib and place extjs inside of it. Then when i create a html document I reference the library by using <script type="text/javascript" src="/lib/extjs/ext-all.js></script>. This is how you can call it up in order to use it. If you have a "app/js" file simply reference it after the example I gave you above so that it is loaded after the ext-all.js file.

Categories