Skip to content

The Righteous Cause

"Equipping Saints, Engaging Culture, Examining Claims"

Menu
  • Recent Posts
Menu

Grok: Can you write code for a Microsoft Edge browser extension?

Posted on March 24, 2025March 24, 2025 by Dennis Robbins

I can help you write code for a Microsoft Edge browser extension, leveraging the information from the web search results. Microsoft Edge extensions are built using web technologies like HTML, CSS, and JavaScript, and they follow the same structure as Chrome extensions since Edge is Chromium-based. Below, I’ll create a simple Microsoft Edge extension that displays a pop-up with a random quote when the user clicks the extension icon. I’ll walk through the necessary files, code, and steps to get it running, based on the tutorial structure in (docs.microsoft.com) and the general guidance in (learn.microsoft.com).


Microsoft Edge Extension: Random Quote Generator

This extension will:

  1. Display a pop-up with a random quote when the user clicks the extension icon.
  2. Use a simple HTML/CSS interface for the pop-up.
  3. Include a JavaScript file to fetch and display a random quote.
  4. Be compatible with Microsoft Edge, as it’s Chromium-based.

Step 1: Set Up the Directory Structure

Create a folder for your extension (e.g., random-quote-extension) with the following files:

  • manifest.json (defines the extension’s metadata and permissions)
  • popup.html (the pop-up UI)
  • popup.css (styles for the pop-up)
  • popup.js (logic to display a random quote)
  • icon.png (a 128×128 icon for the extension)

Step 2: Create the manifest.json File

The manifest.json file is the core configuration file for the extension. It defines the extension’s name, version, permissions, and the pop-up file to display.

{
“manifest_version”: 3,
“name”: “Random Quote Generator”,
“version”: “1.0”,
“description”: “Displays a random quote in a pop-up.”,
“action”: {
“default_popup”: “popup.html”,
“default_icon”: “icon.png”
},
“permissions”: [],
“icons”: {
“128”: “icon.png”
}
}
  • manifest_version: 3 is the latest version as of 2025, ensuring compatibility with modern Edge requirements.
  • action specifies the pop-up file (popup.html) to display when the icon is clicked.
  • No permissions are needed since this extension doesn’t access external APIs or user data.

Step 3: Create the popup.html File

This file defines the structure of the pop-up window.

<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>Random Quote</title>
<link rel=”stylesheet” href=”popup.css”>
</head>
<body>
<div class=”container”>
<h1>Random Quote</h1>
<p id=”quote”>Click the button to get a quote!</p>
<button id=”getQuoteBtn”>New Quote</button>
</div>
<script src=”popup.js”></script>
</body>
</html>
  • The pop-up includes a heading, a paragraph to display the quote, and a button to fetch a new quote.
  • It links to popup.css for styling and popup.js for functionality.

Step 4: Create the popup.css File

This file styles the pop-up to make it visually appealing.

body {
width: 300px;
font-family: Arial, sans-serif;
margin: 0;
padding: 10px;
background-color: #f0f0f0;
}

.container {
text-align: center;
}

h1 {
font-size: 18px;
color: #333;
margin-bottom: 10px;
}

p#quote {
font-style: italic;
color: #555;
margin: 10px 0;
min-height: 40px;
}

button {
background-color: #0078d4;
color: white;
border: none;
padding: 8px 16px;
cursor: pointer;
border-radius: 4px;
font-size: 14px;
}

button:hover {
background-color: #005ea2;
}

  • The styles ensure the pop-up is compact (300px wide, as typical for browser pop-ups) and user-friendly, with a clean design.

Step 5: Create the popup.js File

This file contains the JavaScript logic to display a random quote when the button is clicked.

document.addEventListener(‘DOMContentLoaded’, function() {
const quoteElement = document.getElementById(‘quote’);
const getQuoteBtn = document.getElementById(‘getQuoteBtn’);

// Array of sample quotes
const quotes = [
“The only way to do great work is to love what you do. – Steve Jobs”,
“Life is what happens when you’re busy making other plans. – John Lennon”,
“In the middle of difficulty lies opportunity. – Albert Einstein”,
“You miss 100% of the shots you don’t take. – Wayne Gretzky”,
“The best way to predict the future is to create it. – Peter Drucker”
];

// Function to get a random quote
function displayRandomQuote() {
const randomIndex = Math.floor(Math.random() * quotes.length);
quoteElement.textContent = quotes[randomIndex];
}

// Display a quote on button click
getQuoteBtn.addEventListener(‘click’, displayRandomQuote);

// Display a quote when the pop-up loads
displayRandomQuote();
});

  • The script waits for the DOM to load, then sets up a button event listener to display a random quote from an array.
  • A quote is also displayed immediately when the pop-up opens, enhancing user experience.

Step 6: Add an Icon

You’ll need a 128×128 PNG image named icon.png for the extension’s icon. You can create a simple image (e.g., a quote bubble) using any graphic design tool, or download a free icon from a site like Flaticon (ensure proper licensing). Place it in the extension folder.

Step 7: Load and Test the Extension in Microsoft Edge

  1. Open Microsoft Edge.
  2. Go to edge://extensions/.
  3. Enable “Developer mode” (toggle in the top-right corner).
  4. Click “Load unpacked” and select your random-quote-extension folder.
  5. The extension should appear in your toolbar. Click its icon to see the pop-up, and test the “New Quote” button.

Step 8: Publish the Extension (Optional)

If you want to publish this extension, you can submit it to the Microsoft Edge Add-ons website. You’ll need to:

  • Register a developer account with a Microsoft account.
  • Package your extension files into a ZIP file.
  • Submit it via the Edge Add-ons developer dashboard.

Conclusion

This simple Microsoft Edge extension demonstrates the basics of creating a pop-up, which builds an extension to display an image in a pop-up without JavaScript. Our version adds interactivity with JavaScript, showing how to enhance functionality while keeping the code minimal. The extension is fully compatible with Microsoft Edge since it’s Chromium-based, and it can be easily modified to include more features, like fetching quotes from an API (which would require adding permissions in the manifest). This code provides a solid starting point for anyone looking to develop their own Edge extension.

Share this:

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to email a link to a friend (Opens in new window) Email
  • Click to share on Reddit (Opens in new window) Reddit

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search Posts

News & Commentary

The devil is not fighting religion. He’s too smart for that. He is producing a counterfeit Christianity, so much like the real one that good Christians are afraid to speak out against it. We are plainly told in the Scriptures that in the last days men will not endure sound doctrine and will depart from the faith and heap to themselves teachers to tickle their ears. We live in an epidemic of this itch, and popular preachers have developed ‘ear-tickling’ into a fine art.

~Vance Havner

Email: dennis@novus2.com

Recent Posts

  • Investigative Face Plant: Vincenzo Barney is Wrong.
    Counter-Exposé: The Complex Reality of Founders’ Faith Vincenzo Barney’s sweeping claim fundamentally misrepresents both the diversity of the Founding Fathers’ religious beliefs and their intentions regarding religion in governance. Vanity Fair is not […]
  • Jake Tapper’s Hyperbolic History: The Kimmel Claim Ignores Decades of Actual Government Censorship
    CNN’s Jake Tapper on Jimmy Kimmel being suspended: “It was pretty much the most direct infringement by the government on free speech that I’ve seen in my lifetime.”pic.twitter.com/dZX035lUMl — Breaking911 (@Breaking911) September 23, 2025 WRONG … AGAIN. An […]
  • Theological Analysis: “The Divine Determination of Universal Individual Submission”
    Meet Mark Minnick — Senior Pastor, Mount Calvary Baptist Church, Greenville, SC Mark Minnick earned his M.A. in Bible from Bob Jones University in 1977 and completed his Ph.D. in New Testament Interpretation in 1983. He served as associate pastor under Jesse Boyd at […]
  • The Lapel Pin That Speaks Louder Than Our Words
    I spotted it recently—I won’t say where—a small metal pin proclaiming in large white letters on a red background … “F*ck Trump.” The message was brief, profane, and politically charged. What struck me wasn’t the political sentiment itself, but […]
  • A Critical Examination of Andrew Wommack’s “Effortless Change”: Theological and Apologetic Concerns
    You may have seen this book offering in your Facebook timeline … Have you been longing for lasting change in your life without the struggle? Discover the secret to effortless transformation with Andrew Wommack’s book “Effortless Change”! In this foundational resource, […]
  • In Search of Godly Wisdom: A Comprehensive Guide to Divine Understanding in Christian Living
    A Deep Dive Into the Pursuit of Godly Wisdom Introduction: The Quest for Divine Understanding In the bustling marketplace of ideas that characterizes our contemporary world, the ancient pursuit of wisdom stands as both an enduring human need and a divine imperative. While […]
  • Rebuttal to Lincoln Square’s “Christofascist” Smear of Benny Johnson
    If you have any doubt that America is close to becoming a Christofascist country, this clip of paid Russian propaganda pusher Benny Johnson’s speech from the Charlie Kirk memorial should erase that doubt. This is not what America is supposed to be. Scary shit. […]
  • Beyond the Spotlight: An Investigation into AOC’s Legislative Record and Effectiveness
    A Research Exposé assisted by ClaudeAI. Executive Summary After six years in the House of Representatives, Alexandria Ocasio-Cortez has established herself as one of the most recognizable faces in Congress. Yet beneath the social media presence and activist rhetoric lies a […]
  • “Whoever Has Ears to Hear” The Heart’s Reception to the Gospel
    At East Valley International Church, we’ve witnessed the Holy Spirit move through Wi-Fi signals as powerfully as altar calls, reaching souls who may never enter our building but desperately need to collide with the living Christ. Our generation craves authentic […]
  • “The Bible in a Nutshell” – Dr. Bill Creasy
    I hope you enjoy “The Bible in a Nutshell”, a brief and entertaining jaunt through the entire Bible, Genesis through Revelation. I’ve summarized Dr. Creasy’s 90-minute audio to give a shorter 5-minute version of his lesson. For the past thirty years, Bill Creasy […]
  • Seven Churches, One Warning: Why Modern American Christianity Desperately Needs to Hear Revelation 2-3
    The Seven Churches of Revelation: A Mirror for American Christianity in the 21st Century The Timeless Mirror of Divine Evaluation Nearly two millennia have passed since the Apostle John, exiled on the rocky island of Patmos, received one of history’s most penetrating […]
  • Faith in Action: Record Turnout for HOPE for the Homeless
    Today marks another powerful testament to the body of Christ in action. As volunteers flooded Mountain Park Church for HOPE for the Homeless’ Bag Packing & Meal Prep event on September 20th, 2025, the overwhelming response produced extraordinary results: over […]
  • The Jimmy Kimmel “Cancellation” Myth: A Corporate Decision, Not Free Speech Martyrdom
    While Jay Leno’s recent comment that “usually, it’s the truth that winds up getting canceled” sounds noble in defense of Jimmy Kimmel, it fundamentally misrepresents what actually happened to the late-night host—and reveals the dangerous conflation […]
  • Are We There Yet? Navigating the Road of Christian Sanctification
    A Comprehensive Guide to Understanding The Christian Journey of Transformation Introduction: The Eternal Question of the Journey Every parent knows the familiar refrain that echoes from the backseat during long car trips: “Are we there yet?” This simple […]
  • John 14:2 – In my Father’s House are many mansions.
    Verse of the Day In my Father’s house are many mansions; if it were not so, I would have told you. I go to prepare a place for you” John 14:2 Have you ever felt a twinge of disappointment flipping through your Bible and seeing John 14:2 rendered in a modern […]
©2025 The Righteous Cause | Built using WordPress and Responsive Blogily theme by Superb