Skip to content

Browser extension that instantly displays the roles of the current user in Mendix Apps.

License

Notifications You must be signed in to change notification settings

lightningcell/mendix-role-inspector

Repository files navigation

Role Inspector - Mendix Browser Extension

A browser extension for inspecting user roles on Mendix web applications with multi-language support.

Features

  • 🔍 Role Detection: Automatically detects user roles from CSS classes
  • 🌐 Multi-language Support: Available in English and Turkish
  • 🔎 Role Search: Filter and search through detected roles
  • 🔄 Real-time Updates: Automatically updates when roles change
  • 🎨 Modern UI: Clean and user-friendly interface

Supported Languages

  • English (en) - Default
  • Türkçe (tr) - Turkish

Installation

  1. Download or clone this repository
  2. Open Chrome/Edge and navigate to chrome://extensions/
  3. Enable "Developer mode"
  4. Click "Load unpacked" and select the extension folder
  5. The extension will appear in your browser toolbar

Usage

  1. Navigate to a Mendix application
  2. Click the Role Inspector icon in your browser toolbar
  3. View detected user roles
  4. Use the search box to filter roles
  5. Change language using the dropdown in the top-right corner

Technical Details

File Structure

mendix-role-inspector/
├── manifest.json           # Extension manifest
├── popup.html              # Extension popup UI
├── popup.css               # Popup styles
├── popup.js                # Popup functionality
├── content-script.js       # Content script for role detection
├── i18n.js                 # Internationalization helper
├── language-manager.js     # Language management
├── _locales/               # Localization files
│   ├── en/
│   │   └── messages.json   # English translations
│   └── tr/
│       └── messages.json   # Turkish translations
└── icons/                  # Extension icons
    ├── icon16.png
    ├── icon32.png
    ├── icon48.png
    └── icon128.png

How It Works

  1. Role Detection: The content script scans the page's <body> element for CSS classes starting with role-
  2. Message Passing: Detected roles are sent to the popup via Chrome's messaging API
  3. Internationalization: Uses Chrome's i18n API with fallback support for custom language switching
  4. Language Persistence: User's language preference is stored in Chrome's local storage

Adding New Languages

To add support for a new language:

  1. Create a new folder in _locales/ with the language code (e.g., _locales/es/)
  2. Add a messages.json file with translations
  3. Update the supportedLanguages array in language-manager.js
  4. Add the language option to the select element in popup.html

Example Language File Structure

{
  "extensionName": {
    "message": "Role Inspector",
    "description": "Extension name"
  },
  "userRoles": {
    "message": "User Roles",
    "description": "Roles section title"
  }
}

Development

Prerequisites

  • Chrome/Edge browser with Developer mode enabled
  • Basic knowledge of JavaScript, HTML, and CSS

Local Development

  1. Make changes to the source files
  2. Reload the extension in chrome://extensions/
  3. Test the changes on a Mendix application

Browser Compatibility

  • ✅ Chrome (Manifest V3)
  • ✅ Microsoft Edge (Manifest V3)
  • ❌ Firefox (requires Manifest V2 adaptation)

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Browser extension that instantly displays the roles of the current user in Mendix Apps.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors