Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

141 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GitHub last commit GitHub commit activity GitHub Actions Workflow Status

Macondo+ (or MacondoPlus) is a QoL-focused browser extension for Chrome and Firefox that improves the Macondo website drastically. From dark mode to keyboard shortcuts, from shop goals to displaying your progress on securing your streak for the day, we've got you covered!

Table of contents

Modules

Modules are the main focus of Macondo+. You can toggle on (or off) modules to your heart's content. For developer's, making a module is incredibily easy. You only need 3 lines of code for adding your script as a module!

As the sole developer of Macondo+, I provide frequently updated modules, and new ones almost every day. To stay up to date with new and updated modules, please join the #macondoplus slack channel.

QoL

This is one of the three categories a module can be. This category is for modules that add quality of life improvements to the site.

Better Page Titles

Makes the page titles useful.

Hide Feedback

Hides the annoying NPS (feedback) button.

Hide Idea Generator

Hides the slop project idea generator.

Keyboard Shortcuts

Adds keyboard shortcuts to Macondo. E for Shop, R for Profile, 1-9 for Projects, Esc to exit the current menu you're in, / to search for projects.

Streak Time Display

Display how much time is left until your streak is logged in for the day!

Core

Core modules are not features. It's the engines that make most modules work. This section is aimed at developers who want to build new modules for Macondo+.

Information for how to use Core Modules as a developer is available in this section of this readme.

Appearance

This is one of the three categories a module can be. This category is for modules that add appearance changes to the website.

Dark Mode

Adds dark mode to Macondo (WIP)

Streak Intensity

Adds appearance changes to the Streak Calendar: the more time you spent working on that day, the more darker and red the day gets!

Styling Fixes

Fixes minor styling issues for Macondo that pisses you off.

Tools

This is one of the three categories a module can be. This category is for modules that add additional tools to the website.

Achievements

Adds achievements.

Additional Project Info

Adds additional project metadata that the API exposes.

Shop Categories

Adds categories for shop items and a filter to narrow your search.

Shop Goals

Adds shop goals to the Shop.

Streak Trends

Analyzes your streak calendar and shows trends.

Styling Fixes

Fixes minor styling issues for Macondo that pisses you off.

Shop Sort Enhanced

Adds extra sort options to the shop: A>Z, Z>A, etc.

Silly

This is one of the five categories a module can be. This category is for modules that are silly and do not help to improve the website in any way shape or form. Usually, it's to actually hinder the website.

25% Bluer

Heavily inspired by hit Undertale mod 'Undertale 25% Bluer'. As it says, it makes Macondo 25% bluer.

25% Greener

Heavily inspired by hit Undertale mod 'Undertale 25% Greener'. As it says, it makes Macondo 25% greener.

25% Redder

Heavily inspired by hit Undertale mod 'Undertale 25% Redder'. As it says, it makes Macondo 25% redder.

Ads, Please

Brings forth an extensive range of lucrative premium monetisation possibilities encompassing the whole of the said website.

Deforestation

burn the earth!

Drunk

please don't drive in these conditions! enable at your own risk.

Flashlight

it's so dark here...

Gambling

10% chance of deleting a div.

Googentity's Module

replaces all the text on the page with very inspirational words

In Debt

free debt!

New Project Addict

you cannot do anything except to create new projects

๐–ฑ๐–พ๐—๐—‹๐—ˆ

๐–ฝ๐—‚๐—Œ๐–บ๐–ป๐—…๐–พ๐—Œ ๐—’๐—ˆ๐—Ž๐—‹ ๐–ผ๐—Œ๐—Œ

Rich Pretender

pretend to be rich

Traditionalist

disable the ability to create new projects

Installation

From Source

Unstable

Click on "Actions" on the Navigation bar, click on the first result (for Build Extension .zip), scroll down until you find "Artifacts". Download the "macondoplus-(commit hash)-unzip" and extract it. Then, it will create "macondoplus-use-this-in-extensions-page.zip". Now, follow the specific instructions on your respective browsers:

Chrome

Please do the instructions above this browser-specific tutorial as it is requried.

Go to chrome://extensions/ on the URL bar. Unzip your zip once more to a folder (create one), and press the "Load unpacked" button on the top left of your screen in the Chrome Extensions tab. Choose the folder you just extracted your files to, which should have the images, scripts, manifest.json.

Firefox

Please do the instructions under "From Source" as it is requried.

Go to about:addons on the URL bar. Press on the cogwheel which should be located in the top center-ish part of your screen (underneath the search bar). Press on it and click on "Install Add-on From File...". Select your zip.

From Webstore

Browser Link Users Version
Chromium Chrome Web Store Chrome Web Store Users Chrome Web Store Version
Firefox Firefox Addons Mozilla Add-on Users Mozilla Add-on Version

Developer's Guide

You should have a basic understanding of Javascript and browser extensions before creating a module.

Want to create your very own custom modules for Macondo+? Well, it's simple. Here's a guide on how you can get it up and running!


Local Setup

Some modules (like Streak Trends) use npm packages bundled via esbuild. You'll need Node.js installed.

cd extension
npm install
npm run build

While developing, use watch mode to auto-rebuild on save:

npm run watch

After any rebuild, go to chrome://extensions and click the Refresh button to pick up your changes. (You should be doing this normally anyways, just a general reminder :3)


How the module system works

When the extension loads, it runs content-script.js first. That script creates a global object called window.MacondoPlus that every module can talk to. Think of it as a shared noticeboard that any module can read from.

content-script.js    -> sets up window.MacondoPlus
     ๐Ÿ‘€ โ†“
each module file     -> checks window.MacondoPlus, then does its purpose

The three properties window.MacondoPlus gives you:

Property What it is
MODULES The full list of every registered module (an array of objects)
isEnabled(id) A function. Pass a module's id, get back true or false. This is heavily used to disable the module if it is not enabled. You will likely need to use this.
setEnabled(id, value) A function. Turn a module on or off and save the choice.

Creating a module

Let's create a custom module you will be making yourself. This will teach you basically everything you need. Good luck!

(1) Registering your module

Open extension/scripts/content-script.js. Inside the MODULES array near the top, add a new entry for your module:

If your module is a WIP or is a silly/troll module, please enter false for defaultEnabled.

{
  id: "my-peak-module",        // a unique --> kebab-case <-- id
  name: "My PEAK Module",      // the grammatically accurate name shown in the module manager
  description: "This is PEAK", // shown under the name in the manager
  category: "QoL",             // "QoL", "Tools", or "Appearance"
  defaultEnabled: true         // is it on by default when someone first installs a version with your module?
}
Categories
Category Use it when your module...
"QoL" Makes the site easier or nicer to use
"Appearance" Changes how something looks
"Tools" Adds a brand-new tool or panel
"Core" Powers other modules (only for internal infrastructure; you probably don't need this)

(2) Creating your module file

Create a new file at extension/scripts/modules/my-peak-module.js.

Every module follows the same (or similar, for older modules) three-line skeleton.

(() => {
  if (!window.MacondoPlus?.isEnabled("my-peak-module")) return;

  // your code goes after the if statement
})();

Alternatively, this is what was used for older modules: (and some newer modules) This is not used since nesting if statements are bad programming practices.

Not recommended for general use. This is documented for archival purposes.

if (window.MacondoPlus?.isEnabled("my-peak-module")) {
  // your code goes here
}

The ?. after MacondoPlus is JavaScript's way of saying "only try to call isEnabled if window.MacondoPlus actually exists". It keeps things safe.

(Example) Hiding an element

You should understand basic CSS and how to get a CSS selector for an element first.

(() => {
  if (window.MacondoPlus?.isEnabled("my-peak-module")) return;
  const style = document.createElement("style");
  style.textContent = `
    .element {
      display: none !important;
    }
  `;
})();
(Example) Turning every H1 into custom text
(() => {
  if (window.MacondoPlus?.isEnabled("my-peak-module")) return;
  document.addEventListener("DOMContentLoaded", () => {
    const heading = document.querySelector("h1");
    if (heading) {
      heading.textContent = "Hello Macondo!";
    }
  });
})();

(3) Registering your file in the manifest

Open extension/manifest.json. Find the "js" array inside "content_scripts" and add your file to the list:

โš ๏ธ content-script.js must always be first in this list. It sets up window.MacondoPlus before any module file runs.

"js": [
  "scripts/content-script.js",
  ...
  "scripts/modules/my-peak-module.js"
]

Congratulations, your module is now live!


Using npm packages in a module

Some modules need third-party libraries (e.g. Chart.js). Because browser extensions block external CDN scripts, these are bundled at build time using esbuild.

If your bundle needs an npm package:

  1. Install it: npm install <package-name> (cd into extension/ first or you get exploded)
  2. Add an import at the top of your module file:
import Something from "some-random-ass-package";
  1. Update package.json to add a build entry for your module:
  "scripts": {
    ...,
    "build": "esbuild scripts/modules/my-peak-module.js --bundle --outfile=scripts/modules/my-peak-module.bundle.js",
    ...
  }
  // For multiple bundled modules, chain them with &&.
  1. Register the bundle file (.bundle.js) in manifest.json, not the source file.
  2. Run npm run build before testing.

Using the core modules

A set of tutorials on how to use the core modules.

Using the built-in panel (macondoplus-panel)

The macondoplus-panel core module gives modules that need panels that look like the base website so you don't have to build it from scratch.

(Example) Basic panel
(() => {
  if (window.MacondoPlus?.isEnabled("my-peak-module")) return;
  document.addEventListener("DOMContentLoaded", () => {
    // Create a new panel
    const {open, close, content} = window.MacondoPlus.newPanel();

    // Put whatever HTML you want inside of the panel
    content.innerHTML = `
      <h2>My Module</h2>
      <p>Ts peak!</p>
    `;

    // You can set it to open however you like; here, we use a button click
    const myButton = document.querySelector(".my-trigger-button");
    myButton.addEventListener("click", open);
  });
})();

newPanel() returns three things:

What it does
open() Shows the panel
close() Hides the panel
content The DOM Content; put your HTML inside this

Using the shared styles (macondoplus-styles)

The macondoplus-styles core module injects a small set of reusable CSS animations and utility classes that all modules share. You can use these CSS classes in any HTML your module creates:

Class What it does
macondoplus-panel-open Fades an element in like the Macondo panel.
macondoplus-panel-close Fades an element out like the Macondo panel.
macondoplus-panel-open-with-scale Fades in and zooms in.
macondoplus-panel-close-with-scale Fades out and zooms out.

There are already used by the panel system internally, so you normally don't need to touch them. But if you're building a custom popup or toast notification, they're here for you to freely use.


Additional Information & Tools

What makes a Core module special?

If you look at the module list in content-script.js, you'll see two modules with coreModule: true;

{id: "macondoplus-styles", ..., coreModule: true},
{id: "macondoplus-panel", ..., coreModule: true},

coreModule: true does two things:

  • Make sure the module is always enabled. isEnabled() returns true no matter what the user has modified.
  • The toggle button in the module manager UI is disabled so the user can't accidentally turn it off and break functionality.

โš ๏ธ You should never set coreModule: true on your own module. Only use it if your module provides something that other modules actively depend on to work at all.

Quick-start Checklist

When building a new module, run through this list:

  • Added an entry to the MODULES array in content-script.js
  • Created extension/scripts/modules/your-id.js
  • Used the basic skeleton to check for if the module is toggled on/off.
  • Added the file path to the "js" array in manifest.json
  • If using npm packages: added a build step to package.json and referenced the .bundle.js in the manifest
  • Run npm run build if your module uses npm packages
  • Reloaded the extension in your browser to test

About

Macondo+ is a QoL browser extension for Macondo. (macondo.hackclub.com)

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages