Developing a Scrabble Word Unscrambler extension

(Thadoe Than Htut) #1

Hello, I would like to develop a fire fox extension of an app used to rearrange or unscramble words in local server. Basically I enter a word input at random in an input box and the input will parse on the letters to match with an online dictionary and output the words it could generate from the letters. If there’s any developers here who can advise me on the materials and tools I need to develop, please reply. Thank you.

(Niklas Gollenstede) #2

So what you currently have is a (node.js?) server app with a we frontend and you want to convert that into a WebExtension?

General information about how to write an extension, examples and the web-ext tool can be found on AMO.

Specifically for your case (if I got it right and you want to keep the node.js app as well) is that you would want to share your code modules between node.js and the browser.
normal node modules (which your dependencies likely are, if you have any) with moduleExports = require('module-name') won’t work in the browser.
If your modules don’t require anything, you can just wrap them in a iif and put their exports on the window if exports is not defined.
If you do use require, you could do how module packers like webpack fare for your code, or (I think) you can use import statements in both node.js 10 and the latest browsers.