Komodo - Mods for Komoot

A userscript that adds additional features for route planning on Komoot.com.

当前为 2025-08-19 提交的版本,查看 最新版本

作者
jerboa88
评分
0 0 0
版本
1.0.0
创建于
2025-08-11
更新于
2025-08-19
大小
25.4 KB
许可证
MIT
适用于
Project logo

Komodo - Mods for Komoot

Project category Language Repository size Project license Semantic Release

Experimental Latest release Greasy Fork镜像 Version Install

A userscript for Komoot.com that adds additional features for route planning.


[!WARNING] This is currently an experimental project or proof-of-concept. It may contain bugs or incomplete features, and is not intended for production use. Breaking changes may be made at any time. Consider more stable alternatives for critical applications.

👋 About

Using Komoot for route planning? This script may help. It runs in your browser and adds additional features to the site to help you plan your next adventure.

Features

  • 🏷️ Custom tags:
    • Add: Add custom tags like location, activity type, directionality, or difficulty to your routes
    • Filter: Filter your saved routes by tags to find the perfect route
    • Customize: Customize the appearance of tags using CSS

Screenshots

Screenshot of Komoot's route list page with Komodo
Komoot's route list page with Komodo - v0.1.0

📦 Installation

[!CAUTION] For security reasons, I do not recommend running scripts from the internet unless you understand what they are doing. If you are not a developer, I recommend reading the comments in the code and/or asking a LLM like ChatGPT or Claude to explain it to you.

I recommend using this script with a userscript manager because it will keep the script up-to-date and run it automatically when you visit the appropriate page. If you don't want to do that, you can also run it manually.

Using a userscript manager

A userscript manager is a browser extension that allows you to organize and run scripts on websites. If you don't already have one, I would recommend Violentmonkey, Tampermonkey, ScriptCat, or Greasemonkey. For more choices, see this comparison table.

Once installed, you can click the button below to install the latest version of the script:

Install

You can also install a specific version of the script on the releases page.

Manually

[!NOTE] This only works once. If the page gets reloaded or you navigate away and come back, you will have to run the script again. If you want to run the script automatically, I suggest using a userscript manager.

Alternatively, you can run the script by going to a supported page, copying the code in dist/komodo.user.js, and pasting it into your browser's devtools console. The following pages are supported:

Detailed instructions:
  1. Open komoot.com/user/YOUR_USER_ID/routes or komoot.com/tour/YOUR_ROUTE_ID in your browser
  2. Open your browser's devtools console (how?)
  3. Copy the code in dist/komodo.user.js and paste it into the console. If this doesn't work or you see a warning message about pasting, see the FAQ.
  4. Press enter to run the script. You should see the page update. If this doesn't happen, see the FAQ.

🕹️ Usage

All UI elements added to the Komoot website have a lizard icon (🦎) in the top right corner so they can be easily identified.

Adding tags to routes

Tags can be added to a route by including a specially formatted label in the route name using the Komoot website or app as usual. There is currently no visual editor for tags.

Each tag must be in the format [tagName:tagValue] and adhere to the following formatting rules:

  • Multiple tags can be added to a route, and they can be added anywhere in the route name (ex. [status:WIP] My Route [direction:north])
    • Note that tags will be stripped from the route name, so if you add them inbetween words, the resulting title may have weird spacing
    • If you want cleaner route names on mobile, consider adding them at the end
  • Tag names and values are case-sensitive (ex. [status:WIP] is different from [status:wip])
  • You can include whitespace around names and values—it will be stripped out when the tag is displayed (ex. [a:b], [a: b], and [ a : b ] are all equivalent)
  • Spaces in the middle of tag names and values will be preserved, so you can have multi-word names and values (ex. [Start Point:Home])
  • The special characters [, ], and : are not allowed in tag names and values because they are used to delimit tags. Emojis, spaces, and all other characters are allowed (ex. [🚗:💨] is valid)

For example, setting a route name to [status:WIP] My Route [Start_Point:Home] [direction:north] will add the following tags to the route:

direction: north Start Point: Home status:WIP

Loading all routes

This script uses the tags found in the route list to populate the filter controls.

By default, Komoot only loads a handful of routes at a time, so if you notice that some tag names/values are missing from the filter controls, click the Load All Routes button to force load the entire list of routes. This may take a few seconds to complete.

Filtering by tags

On the route list page, you can filter routes by tag.

Details:

  • A select box will be added to the Filter by section for each tag name. You can filter by multiple tag names at once.
  • Selecting a value will filter the route list to only show routes with that value.
  • Use Ctrl+Click to select multiple values or to unselect a previously selected value.

🤖 Advanced Usage

Customizing the appearance of the UI

This script adds various classes, ids, data attributes, and CSS variables to the elements it creates or modifies. You can use these to further customize the appearance of the UI. To add custom CSS to pages, you can use a user style manager like Stylus.

For example, you could use the following CSS to change the background color and add an emoji to all pills with the name status and the value wip:

.komodo-pill[data-komodo-tag-name='status'][data-komodo-tag-value='WIP'] {
  background: orange;

  & > div::before {
    content: '🚧 ';
    font-size: x-small;
  }
}
Screenshot of custom pills on the route list page
Custom pills on the route list page - v0.1.0

Refer to the following files for details on the attributes added:

HTML select elements have their id set to an escaped version of the tag name which can be used for styling. For simple tag names like status, the id will also be status. For tag names with spaces or special characters like start point, the id will be something like start_u0020_point. It's probably easiest to inspect the element in your browser's dev tools to see what the id is if you want to use these values.

Tags pills have multiple children so that you can style the name, value, and separator separately. This is handy because you can use an easy to type tag name like loc, but use CSS to replace the original value with something more readable like Location or even an emoji like 📍. You can even hide parts of the tag completely to save space if you wish.

For a more complete example, see [https://cdn.jsdelivr.net/gh/jerboa88/komodo/examples/custom-styles-for-komodo.user.css]. These are similar to the styles I am actually using:

Screenshot of a kitchen sink style for the route list page
Kitchen sink styles ([https://cdn.jsdelivr.net/gh/jerboa88/komodo/examples/custom-styles-for-komodo.user.css]) on the route list page - v0.2.0

❓ FAQ

Nothing shows up when I paste in the console / I get a warning when I try to paste in the console

Some browsers prevent you from pasting code in the console because it could be malicious. This is called Paste Protection and you can read more about it on the Chrome for Developers Blog.

If this happens, follow the instructions in the console to re-enable pasting, and then try again. For Chrome, the following steps should work:

  1. Try to paste something in the console. You should get a warning message about pasting
  2. Type "allow pasting" in the console and press enter

See this video for a visual walkthrough.

I get an Uncaught SyntaxError: Unexpected identifier error when running the script

Make sure that you select the entire file with Ctrl + A when copying it. If part of the script is cut off, it won't work.

🤝 Contributing

If you encounter any problems with the script, feel free to create an issue.

Pull requests, bug reports, translations, and other kinds of contributions are greatly appreciated. By contributing code, you agree to license your contributions under the terms of the [LICENSE].

Background

This project is written in TypeScript and uses Vite and vite-plugin-monkey to bundle the code into a single file that can be installed as a userscript.

We use Bun for package management. You can use another package manager if you want, but you'll have to replace refererences to bun or bunx in the following places:

  • Script commands in package.json
  • Husky hooks in .husky/*
  • Workflows in .github/workflows/*

The Conventional Commits specification is used for commit messages. These conventions are enforced using Commitlint via Husky pre-commit hooks.

Commitizen is set up as well, so you can use bun commit to commit changes using an interactive prompt instead of git commit.

Biome is used for linting and formatting.

Semantic Release is used to automate the release process.

Getting Started

To work on the project locally, first clone the repository and run bun install to install the dependencies.

To build the script, run bun run build. This will create a dist folder with the compiled script.

To run the script in development mode, run bun run dev. This will start a development server that will watch for changes and rebuild the script automatically.

🧾 License

This project is licensed under the MIT License. See [LICENSE] for details.

The project logo is from the Fluent Emoji collection, licensed under the MIT License.

This project is not affiliated with or endorsed by Komoot in any way.

🖇️ Related

💕 Funding

Find this project useful? Sponsoring me will help me cover costs and commit more time to open-source.

If you can't donate but still want to contribute, don't worry. There are many other ways to help out, like:

  • 📢 reporting (submitting feature requests & bug reports)
  • 👨‍💻 coding (implementing features & fixing bugs)
  • 📝 writing (documenting & translating)
  • 💬 spreading the word
  • ⭐ starring the project

I appreciate the support!

[https://cdn.jsdelivr.net/gh/jerboa88/komodo/examples/custom-styles-for-komodo.user.css]: https://cdn.jsdelivr.net/gh/jerboa88/komodo/examples/custom-styles-for-komodo.user.css [LICENSE]: LICENSE

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址