Huge Monarch Update!

I’ve been working on a big update to Monarch (formerly Glitch Autocompletions), and I can’t wait to share it with y’all.
So, without further ado, let’s begin.

What is Monarch?

Monarch is a browser extension that tweaks the Glitch editor to add nice little features here and there (see below for features).
It was initially made for just JavaScript Autocompletions, but I’ve developed it to add quite a few more things.

Features

Autocompletions

Monarch adds (extremely) simple autocompletions for any .js (JavaScript) file you make.
They aren’t in any way perfect, as development is still going on, but they are nice to have sometimes.

Asset Folders

The big thing that Monarch 4.0 adds are Asset Folders.
Folders are a nice way to group your heaping mess of assets into nice little bundles of colour.

Additional Themes

Monarch has a not-so-simple feature to choose alternate themes for the Editor.
They aren’t great, but it’s a proof of concept.

I’m interested, how do I get it?

You need to make sure that your browser is Chromium-based.
After you have verified, you can install Monarch (Click the link to see installation steps).

Thanks

Thanks to Tiago for helping clean up a little code and improve performance.
Thanks to all y’all for the support and help with the (many) problems I’ve encountered.

Outro

I hope at least one person found this write up interesting, as it was quite a long one.

And that’s all I’ve got,
Thanks and Cheers.

(Oh, and Tiago. I am working on stopping autocompletions inside strings)

2 Likes

Looks really nice! I just noticed there’s a bug where the themes mess up on start, and you have to change and then re-select your theme for it to work correctly. [issue]

1 Like

I will look into it! Thanks!

1 Like

do you guys plan on adding support for firefox? i think it would be easy

1 Like

I’ve actually tried adding Firefox support, but sadly it probably won’t work.
Firefox is missing a needed component called ExecutionWorld.

You can see my github post here.

Sorry about that, but I may eventually find a work around (not likely).

1 Like

When I have some time I’ll look into that to try to see if it’s possible and if it is make a PR. Maybe an userscript is the solution, idk?

1 Like

I don’t think that’s the issue because according to the compatibility table, ExecutionWorld seems to be supported.

Another reason is that I just got it working on Firefox (128.0.3), although I’m not sure to what extent.

Theming is bugged because of [bug] Cosmos theme messed up on extension start · Issue #4 · Haizlbliek/Monarch · GitHub
Monarch on Firefox GIF

how to fix

In your manifest.json,

{
  ...
  "background": {
    "service_worker": "script.js",
+   "scripts": ["script.js"]
  }
}

why

Apparently, its a manifest v3 feature that Firefox doesn’t support, and so you have to give candy to both Firefox and v3 (Chrome) so that they’re both happy.

1 Like

MAIN is out

Manifest V3 updates landed in Firefox 128 - Mozilla Add-ons Community Blog

2 Likes

I’ve gotta update my Monarch soon now…

Thanks y’all!

2 Likes

I think you can detect whether we’re in a string by looping through every character of the editor’s value and search for 'smth', "smth" and the ` (markdown inline-code breaks with that character) and converting to smth like…

[
	{
		ch: "\"",
		range: [0, 7],
		txt: "\"ur mom\""
	}
]

And check if the cursor is in one of those ranges. :stuck_out_tongue:

1 Like

that would prob need a lil bit of optimization to handle bigger files tho

1 Like

Maybe something like Regex matches and range from that, I dunno?

1 Like