Tumgik
#programming project
izicodes · 1 year
Text
Coding A Simple Firefox Extension
Tumblr media
Hiya! Today I want to share my experience creating a simple Firefox extension. I was a bit intimidated by the idea of creating an extension, but I was determined to give it a try! Been on my 'projects to-do' list for a long time! 😅
I found that the process was actually quite straightforward, and with some guidance from a couple of YouTube videos, I was able to create a working (temporary) extension in just an hour. My hope is that this post will serve as a helpful guide for anyone who is interested in creating their own Firefox extension~!
Tumblr media
What exactly are we making?
Tumblr media Tumblr media
We will be making a simple temporary extension - an extension that only you have access to e.g. end-users will not be able to use the extension. This is a way to test if your extension works and find issues. I might make another post on how to actually upload it for other people to use, but for now, this method is for you to use the extension.
This is the link to the official Mozilla Firefox 'Temporary installation' Guide' for extenisions - LINK
Now, for the steps into making the extension:
Setting up the development environment
Creating a manifest file
Adding a pop-up window
Attaching JavaScript functionality to a button
Load your extension in Firefox
Let's get started~!
Tumblr media
Step 1 - Setting up the development environment
Tumblr media Tumblr media
Obviously, you will need to have Firefox installed on your computer. You will also need a code editor, such as Visual Studio Code or Sublime Text, to write your code. I'm going to use VS Code.
In your code editor, create a new folder where you will store your extension files. You can name this folder whatever you like. For this example, I will call it 'Firefox Extension'. I also recommend adding the following files in the folder:
index.html (or in this case popup.html file)
icon image in .png or .jpg or similar formats
manifest.json - talked about in the next step
script.js
Step 2 - Creating a manifest file
Tumblr media
The most important file I believe when creating an extension is the manifest JSON file. This file will contain metadata about your extension, including its name, version, and permissions. In your new folder, create a new file called "manifest.json".
This is the general structure of the file. The icon size you need to have is 48x48 pixel size image and then you can have others to be responsive to screensizes, I just added one extra. The 'browser_action' part includes the default icon image that will display an icon in the Firefox toolbar and the popup html file. In 'scripts', that is where we will add the JavaScript code to run.
Step 3 - Adding a pop-up window
Tumblr media
The code simply displays the text "Hello World" and a button in the center of the window. I assume you're good at your HTML and CSS so I won't go into too much detail here but the CSS is in the style tags within the head tags and what we can see also is what is between the body tags - the 'Hello World' and the 'Click me!' button.
Don't forget to include the script tag at the end of the body tag so it'll link to the script.js file in your folder AND include "scripts": ["script.js"] in the manifest.json for the javascript code.
Step 4 - Attaching JavaScript functionality to a button
Tumblr media
Again, I hope you very basic JavaScript. This code basically adds an event listener to the button with the ID "myBtn" (which is the button with 'Click me!' on it). When the button is clicked, it changes the heading 1 text from 'Hello World' to 'The button was clicked!'.
And that it! Done with all the coding part and now to upload it for you to use~!
Step 5 - Load your extension in Firefox
Tumblr media
Open Firefox and type "about:debugging" in the address bar. This will open the Firefox Developer Tools page. Click the "This Firefox" section to the left of the page, then click "Load Temporary Add-on". Navigate to your extension folder and select the manifest.json file.
The extension is now loaded in Firefox! Click the icon in the toolbar to see your pop-up window!
Tumblr media
Whenever you make changes to the extension, back on the Firefox Developer Tools page, click the 'Reload' button on your extension section and changes should show up!
Tumblr media
I hope that this post has been helpful to you and that it has inspired you to create your own Firefox extension! 👩🏾‍💻💗 Remember, the most important thing is to have fun and experiment with different ideas - play with the colours or sizes or the javascript code! Don't be afraid to try new things and explore!!
Extra links that helped me learn:
How to build an extension for Firefox in less than 5 minutes [video]
Temporary installation in Firefox [webpage]
Thanks for reading 🥰💗
162 notes · View notes
d0nutzgg · 9 months
Text
Tumblr media
Tonight I am hunting down venomous and nonvenomous snake pictures that are under the creative commons of specific breeds in order to create one of the most advanced, in depth datasets of different venomous and nonvenomous snakes as well as a test set that will include snakes from both sides of all species. I love snakes a lot and really, all reptiles. It is definitely tedious work, as I have to make sure each picture is cleared before I can use it (ethically), but I am making a lot of progress! I have species such as the King Cobra, Inland Taipan, and Eyelash Pit Viper among just a few! Wikimedia Commons has been a huge help!
I'm super excited.
Hope your nights are going good. I am still not feeling good but jamming + virtual snake hunting is keeping me busy!
40 notes · View notes
sivaniverse · 1 year
Text
POV you are working on a project. Lots of code and multiple datasets and processed datasets and files later when your code isn't working the way it is supposed to. So you have decided to delete everything and restart. It hurts to delete all these things after working so hard on them. But another part of me feels relieved to declutter and once again start afresh with a clean slate.
Tumblr media
31 notes · View notes
hermit-frog · 19 days
Photo
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
1K notes · View notes
fawfulydoo · 6 months
Text
Tumblr media
babies first toon boom harmony animation
2K notes · View notes
ihatebrainstorm · 16 days
Text
Quick little thingy I made for an assignment,, The sheer blood boiling turmoil this assignment gave me last week holy crap ToT
900 notes · View notes
muffinlance · 8 months
Text
Oh so the clown ads are over? Too late Tumblr I already cancelled ad free uninstalled your app and discovered the power of ublock in mobile FireFox. AND tags are editable in the web version?
There's no going back
1K notes · View notes
critterpdf · 9 months
Text
Tumblr media Tumblr media
some lesbians having music moments <3
1K notes · View notes
pantherloid · 20 days
Text
Tumblr media
The duality of Kaito.
290 notes · View notes
lonestarflight · 1 month
Text
Tumblr media
Armstrong and Scott with Hatches Open
"Astronauts Neil A. Armstrong and David R. Scott sit with their spacecraft hatches open while awaiting the arrival of the recovery ship, the USS Leonard F. Mason after the successful, but early, completion of their Gemini VIII mission. They are assisted by USAF Pararescuemen Eldrige M. Neal, Larry D. Huyett, and Glenn M. Moore. The overhead view shows the Gemini 8 spacecraft with the yellow flotation collar attached to stabilize the spacecraft in choppy seas. The green marker dye is highly visible from the air and is used as a locating aid."
Date: March 16, 1966
NASA ID: S66-18602
237 notes · View notes
humanoidhistory · 1 year
Photo
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Snapshots from the Gemini 7 mission, December 4-18, 1965.
2K notes · View notes
doctorsiren · 4 months
Text
every time I mention Ace Attorney around my (defense lawyer) father, he asks if I’ll be going to law school now
the best bit was me telling him that if I did that, I would be fulfilling the Phoenix Wright prophecy because I’d be dropping my art degree to pursue law
274 notes · View notes
d0nutzgg · 9 months
Text
Life Updates: buildspace, an Idea, and some Concepts
Hey everyone, thanks for all the support on my prior posts having to do with machine learning! I know I didn't mention this really but recently I was accepted into S4 of buildspace which is like a "school" for creatives. I am doing Nights & Weekends but it has been a lot of fun since I started! We just did our first project which was creating the idea we will be working on throughout this "season" of buildspace. This was mine:
Tumblr media
I know you all can tell I am really passionate about helping others with the research I do with machine learning / AI. I am wanting to make it into a nonprofit type business while I am in buildspace for s4.
I have some Proof of Concepts already which you can check out on my Kaggle here:
However, I am working on another project today that uses Logistic Regression and XGBoost models stacked together to predict heart failure mortality. I plan on doing a full walk through of the project to help show investors and buildspace what my goal is for my business.
What are your ideas on this? Do you think I should go for it? What are your dreams if you are a software engineer yourself? I want to hear from you all!
4 notes · View notes
sivaniverse · 1 year
Text
I completed a project today!
I did a small scale, self assigned project, but nevertheless a project. Something I wanted to do. And it turned out so well. Chef's kiss. I restarted it three times after starting it in the morning. But it was worth spending a whole day on it!!
I'm going to make my next YouTube video about it!
24 notes · View notes
alwaysbewoke · 1 month
Text
Tumblr media Tumblr media
174 notes · View notes
l3viathanss · 9 months
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
24 HOURS UNTIL THE TOMB OPENS—PAUL GETS BORN
416 notes · View notes