Away_in_the_heavens's blog

By Away_in_the_heavens, 3 months ago, In English

Hello, Codeforces!

Massive update + Firefox Addon

This is my first browser extension, and I made it to solve a small annoyance I often have while reading C++ submissions: too many macros, especially short aliases for loops and common operations.

Chrome Web Store: install Codeforces Un-definer

Firefox Add-ons: install Codeforces Un-definer for Firefox

GitHub: source code

Codeforces Un-definer adds small intuitive interface buttons near #define, typedef, and simple using alias lines. When you click one, the declaration is crossed out and its usages are rewritten inline in the code. This way, you can easily turn macros and aliases on and off while reading.

For example, here is a comparison image:

Codeforces Un-definer example

Massive update

The extension has received a large update based on feedback.

What changed: - Added support for AtCoder, QOJ, OJUZ, and CodeChef submission pages.

  • Added a popup menu to enable or disable the extension per supported site.

  • Added support for simple typedef aliases.

  • Added support for simple using aliases.

  • Added support for template using aliases, for example template<class T> using V = vector<T>;

  • Improved support for nested aliases, for example using vi = V<int>;

  • Added best-effort support for multiline #define macros.

  • Added best-effort support for variadic macros using __VA_ARGS__

  • Improved button placement and scrolling behavior in Ace-based code viewers.

  • Improved changed-line highlighting and color preservation.

  • Added a Firefox version.

  • The extension now ignores submit/custom-test/compiler pages where it should not run.

The current expansion logic is still lightweight. It works well for many common competitive programming macros and aliases, but it is not a full C++ preprocessor. Very complex macros, unusual formatting, and advanced template tricks may still fail or produce confusing text.

If you find a common case where it fails, or if you have any suggestions, feel free to report it on GitHub Issues or write it in the comments:

GitHub Issues

I plan to keep updating it if I receive useful feedback or suggestions.

Chrome Web Store: install Codeforces Un-definer

Firefox Add-ons: install Codeforces Un-definer for Firefox

  • Vote: I like it
  • +97
  • Vote: I do not like it

»
3 months ago, hide # |
← Rev. 2  
Vote: I like it +19 Vote: I do not like it

Edit: All of the issues I mentioned above have been fixed, huge kudos to the author!

__VA_ARGS__, overloaded rep/per-style macros, and multi-line macros all work properly now. I've been using it for a while now and it works great. This is probably the extension I've needed for so long lol. It also works great on maspy's template and other users with very macro-heavy templates.

»
3 months ago, hide # |
 
Vote: I like it +19 Vote: I do not like it

Finally I can understand this submission.

»
3 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Great extension, especially when added "using" and multi-row defines support

»
3 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

круууть

»
3 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

John F. Kennedy was wrong this is peak