metabase / metabase/metabase

shareable URLs for iframed embedded dashboards, with param filter values

Open
#7,811 11 comments 12 reactions 0 assignees View on GitHub
.Team/Embedding Embedding/ Type:New Feature
Dominant language
Clojure
Stars
49.3k
Forks
6.8k
Avg merge
1d 13h
Merged PRs (30d)
653

Description

hi all! we're working on a public embedded dashboard with filter widgets, and we'd love a way to let users share URLs to specific queries they've come up with, ie including filter values.

this is obviously doable when you load a public/embedded dashboard at the top level in the browser. when you filter, it updates the URL in the browser to include query params for each filter value. this feels very natural, and sharing works great, without needing any explicit UI affordance. yay!

i've been looking for a way to do the same thing when a dashboard is embedded in an iframe. obviously this needs some support from the outer application/ HTML that's embedding the dashboard, since it controls its URL. i'm happy to write JS to eg look at the dashboard iframe's `src` attribute and grab its query params, but from what i can tell, iframed dashboards don't update `src` when their filters change. i don't know if this is an HTML/DOM limitation, or just something that's not implemented in metabase, or a bug...?

i know i could hack metabase's `Content-Security-Policy` `script-src` to let my embedding HTML reach inside the iframe's document, and i might end up doing that, but it feels ugly.

another option would be a new "permalink" UI affordance in embedded dashboards. the drawback is, that would be the dashboard's direct URL, not the embedding parent's URL...unless we add a new setting for that, which starts to maybe feel overcomplicated.

the last idea i have is to let users provide optional arbitrary HTML header and footer snippets that metabase would inject wrap around the dashboard HTML it serves. sounds like a bad idea for all sorts of reasons.

apologies for rambling. thanks in advance for considering this!

:arrow_down: Please click the :+1: reaction instead of leaving a `+1` or `update?` comment

Contributor guide

Open the contributing guide

Research direction

Start by investigating embedded dashboard filter widgets, iframe URL behavior, and how filter values are represented in the dashboard URL. Compare updating the iframe's src with a permalink or embedding API approach, then define a supported way for the parent page to share the active filter state.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.