Skip to content

IT-BAER/nc-iframewidget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ–ผ๏ธ iFrame Widget for Nextcloud

Nextcloud App Store Version License GitHub stars

Display external websites directly in your Nextcloud dashboard with this customizable widget

In this example, I added my Glance Dashboard as an iFrame

โœจ Features

  • ๐ŸŒ Embed any website in your Nextcloud dashboard
  • ๐Ÿ”ค Customizable widget title
  • ๐ŸŽจ Support for custom icons using Simple Icons with the si: prefix
  • ๐ŸŽญ Custom icon coloring
  • ๐Ÿ“ Adjustable iframe height
  • ๐Ÿ–ฅ๏ธ Extra-wide display option (2 columns)
  • ๐ŸŽฏ Clean, responsive design that integrates with Nextcloud themes
  • ๐Ÿ‘ค Separate Personal and Public iFrame Widgets
  • ๐ŸŒ Multi-language support with translations

๐Ÿš€ Upcoming Features

  • ๐Ÿ“Š 3-Column Size
  • ๐Ÿ”„ Refresh Button (or Refresh Timer Option)
  • ๐Ÿ‘ฅ Widget per Group allocation

๐Ÿ“ธ Screenshots

๐Ÿ–ฅ๏ธ Widget in Dashboard โš™๏ธ Admin Settings

The iFrame Widget provides both admin/public and personal configuration options, allowing administrators to set up shared widgets for all users while enabling individual users to create their own personalized widgets.

โš™๏ธ Configuration

๐Ÿ‘ฅ Admin/Public Widget Settings

Access the administrator settings from:

  1. Settings โ†’ Administration โ†’ iFrame Widget
  2. Configure the following options:
    • ๐Ÿ”ค Widget Title: Set a custom title (or leave empty to hide the header)
    • ๐ŸŽจ Widget Icon: Enter an icon name with si: prefix (e.g., si:github)
    • ๐ŸŽญ Icon Color: Choose a custom color for the icon
    • ๐ŸŒ URL to Display: The website URL to embed
    • ๐Ÿ“ iFrame Height: Set a fixed height or use 100% (default)
    • ๐Ÿ–ฅ๏ธ Extra Wide: Toggle to span two dashboard columns

These settings apply to the public widget that appears on all users' dashboards.

๐Ÿ‘ค Personal Widget Settings

Each user can configure their own personal iFrame widget:

  1. Settings โ†’ Personal โ†’ iFrame Widget
  2. Configure the following options:
    • ๐Ÿ”ค Widget Title: Set a custom title for your personal widget
    • ๐ŸŽจ Widget Icon: Choose your preferred icon with si: prefix
    • ๐ŸŽญ Icon Color: Set a custom color for your widget icon
    • ๐ŸŒ URL to Display: Add your personal website URL to embed
    • ๐Ÿ“ iFrame Height: Adjust the height to fit your needs
    • ๐Ÿ–ฅ๏ธ Extra Wide: Enable for a wider widget view

Personal widgets are visible only to the user who configured them and don't affect other users.

๐ŸŽจ Icon System

This widget uses Simple Icons for custom icons:

si:iconname

For example:

  • si:github - GitHub icon
  • si:youtube - YouTube icon
  • si:nextcloud - Nextcloud icon

Browse available icons at SimpleIcons.org.

๐Ÿ“‹ Requirements

  • ๐Ÿ“ฆ Nextcloud 30+
  • ๐ŸŒ Website to be embedded must allow iframe embedding (not all sites do)
  • ๐Ÿ”’ Content Security Policy (CSP) configuration to allow external domains in iframes

๐ŸŒ Translations

iFrame Widget supports multiple languages and can be translated. Currently, the following languages are available:

  • ๐Ÿ‡ฌ๐Ÿ‡ง English (en)
  • ๐Ÿ‡ฉ๐Ÿ‡ช German (de)
  • ๐Ÿ‡ซ๐Ÿ‡ท French (fr)
  • ๐Ÿ‡ช๐Ÿ‡ธ Spanish (es)
  • ๐Ÿ‡ฎ๐Ÿ‡น Italian (it)
  • ๐Ÿ‡ณ๐Ÿ‡ฑ Dutch (nl)
  • ๐Ÿ‡ท๐Ÿ‡บ Russian (ru)
  • ๐Ÿ‡ต๐Ÿ‡ฑ Polish (pl)
  • ๐Ÿ‡ต๐Ÿ‡น Portuguese (pt)
  • ๐Ÿ‡ง๐Ÿ‡ท Brazilian Portuguese (pt_BR)
  • ๐Ÿ‡จ๐Ÿ‡ณ Chinese (Simplified) (zh_CN)
  • ๐Ÿ‡ฏ๐Ÿ‡ต Japanese (ja)
  • ๐Ÿ‡จ๐Ÿ‡ฟ Czech (cs)
  • ๐Ÿ‡ธ๐Ÿ‡ช Swedish (sv)
  • ๐Ÿ‡ณ๐Ÿ‡ด Norwegian Bokmรฅl (nb)

If you'd like to contribute translations, please see the translation guide.

๐Ÿ”’ CSP Configuration

By default, Nextcloud restricts which websites can be embedded in iframes for security reasons. To embed external websites in your dashboard widget, you'll need to add them to your server's Content Security Policy configuration:

For Apache

Add the following to your Apache configuration or .htaccess file:

# Allow specific domain in iframes
Header set Content-Security-Policy "frame-src 'self' https://example.com;"

# If you need to allow multiple domains
Header set Content-Security-Policy "frame-src 'self' https://example.com https://another-site.org;"

For Nginx

Add the following to your Nginx server block:

# Allow specific domain in iframes
add_header Content-Security-Policy "frame-src 'self' https://example.com;";

# If you need to allow multiple domains
add_header Content-Security-Policy "frame-src 'self' https://example.com https://another-site.org;";

โ„น๏ธ Note on External Websites

Some websites explicitly block being embedded in iframes using their own CSP headers (X-Frame-Options: DENY or frame-ancestors: 'none'). These sites cannot be embedded even if you configure your server correctly. In these cases, consider using the External Sites app with the redirect option instead.

๐Ÿ” Security Notes

  • ๐Ÿ›ก๏ธ Websites embedded through iframes operate within their own security context
  • ๐Ÿšซ Some websites block embedding using X-Frame-Options headers
  • โœ… Use trusted sources for embedded content

โ“ FAQ

๐Ÿ” Personal widget settings cannot be saved after upgrading to v0.7.0

If you experience issues with saving personal widget settings after upgrading to v0.7.0, try the following solutions:

  1. ๐Ÿ—‘๏ธ Clear the Nextcloud cache:

    php occ maintenance:mode --on
    php occ memcache:clear
    php occ maintenance:mode --off
  2. ๐Ÿ”„ Restart your web server: For Apache:

    sudo systemctl restart apache2

    For Nginx:

    sudo systemctl restart nginx
    sudo systemctl restart php-fpm
  3. โ™ป๏ธ Disable and re-enable the app:

    php occ app:disable iframewidget
    php occ app:enable iframewidget
  4. ๐Ÿ” Check your browser console for JavaScript errors: If you see CSRF token errors, clearing your browser cache might help.

๐Ÿ” Widget doesn't appear on the dashboard

If the widget doesn't appear on your dashboard after installation:

  1. Make sure you've added it from the dashboard customization screen (+ button)
  2. Verify that there are no JavaScript errors in your browser console
  3. Check that the app is properly enabled: php occ app:list | grep iframe

โ“ What's the difference between admin and personal widgets?

  • Admin/Public Widget: Configured by administrators and appears on all users' dashboards with the same content
  • Personal Widget: Each user can configure their own widget that's visible only to them
  • You can use both simultaneously - users can have the admin-configured widget and their own personal widget

Both widgets need to be added to your dashboard using the "+" button in dashboard customization.

๐Ÿ’œ Support Development

If you find this app useful, consider supporting this and future developments, which heavily relies on coffee:

Buy Me A Coffee

๐Ÿ“„ License

This project is licensed under the AGPL-3.0-or-later license.

๐Ÿ‘ Credits