Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make allow attribute configurable in iframe panel #19087

Merged
merged 25 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3de9c67
Make allow attribute configurable in iframe panel
tomayac Dec 19, 2023
13df473
Delete .vscode/settings.json
tomayac Dec 19, 2023
edd6c5c
Update ha-panel-iframe.ts
tomayac Dec 19, 2023
3bdfa31
Don't quote
tomayac Dec 19, 2023
e628d09
Update src/panels/iframe/ha-panel-iframe.ts
tomayac Jan 8, 2024
791e445
Make `allow` configurable for `hui-iframe-card`
tomayac Jan 8, 2024
88e35af
Merge branch 'dev' into iframe-allow-attribute
tomayac Jan 8, 2024
3cb252a
Merge branch 'dev' into iframe-allow-attribute
tomayac Jan 9, 2024
8d5686c
Update src/panels/iframe/ha-panel-iframe.ts
tomayac Jan 10, 2024
0cd3a10
Update src/panels/lovelace/cards/hui-iframe-card.ts
tomayac Jan 10, 2024
8bf62c6
Update src/panels/iframe/ha-panel-iframe.ts
tomayac Jan 10, 2024
bf373f8
Merge branch 'dev' into iframe-allow-attribute
tomayac Jan 10, 2024
43b3b15
Update src/panels/lovelace/cards/hui-iframe-card.ts
tomayac Jan 17, 2024
0a9e3ce
Merge branch 'dev' into iframe-allow-attribute
tomayac Jan 17, 2024
ce7d789
Merge branch 'dev' into iframe-allow-attribute
tomayac Jan 17, 2024
a058bbf
Merge branch 'dev' into iframe-allow-attribute
tomayac Jan 22, 2024
73fa3d2
Merge branch 'dev' into iframe-allow-attribute
tomayac Mar 11, 2024
0b768b9
Merge branch 'dev' into iframe-allow-attribute
tomayac Apr 8, 2024
c9d48c9
Delete src/panels/iframe/ha-panel-iframe.ts
tomayac Apr 12, 2024
191221e
Merge branch 'dev' into iframe-allow-attribute
tomayac Apr 12, 2024
5c9db5b
Restore dev
tomayac Apr 12, 2024
b94f313
Update ha-panel-iframe.ts
tomayac Apr 12, 2024
e75c18d
Prettier
tomayac Apr 15, 2024
3ff205e
Merge branch 'dev' into iframe-allow-attribute
tomayac Apr 15, 2024
ce81912
Merge branch 'dev' into iframe-allow-attribute
tomayac Apr 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/panels/iframe/ha-panel-iframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class HaPanelIframe extends LitElement {

@property({ type: Boolean }) narrow!: boolean;

@property() panel!: PanelInfo<{ url: string }>;
@property() panel!: PanelInfo<{ url: string, allow: string }>;
tomayac marked this conversation as resolved.
Show resolved Hide resolved

render() {
if (
Expand Down Expand Up @@ -41,7 +41,9 @@ class HaPanelIframe extends LitElement {
)}
src=${this.panel.config.url}
sandbox="allow-forms allow-popups allow-pointer-lock allow-same-origin allow-scripts allow-modals allow-downloads"
allow="fullscreen"
allow=${ifDefined(
this.panel.config.allow ?? 'fullscreen'
)}
tomayac marked this conversation as resolved.
Show resolved Hide resolved
></iframe>
</hass-subpage>
`;
Expand Down
4 changes: 3 additions & 1 deletion src/panels/lovelace/cards/hui-iframe-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ export class HuiIframeCard extends LitElement implements LovelaceCard {
title=${ifDefined(this._config.title)}
src=${this._config.url}
sandbox="${sandbox_user_params} allow-forms allow-modals allow-popups allow-pointer-lock allow-same-origin allow-scripts"
allow="fullscreen"
allow=${ifDefined(
this._config.allow ?? 'fullscreen'
)}
tomayac marked this conversation as resolved.
Show resolved Hide resolved
></iframe>
</div>
</ha-card>
Expand Down
1 change: 1 addition & 0 deletions src/panels/lovelace/cards/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export interface IframeCardConfig extends LovelaceCardConfig {
allow_open_top_navigation?: boolean;
aspect_ratio?: string;
title?: string;
allow?: string;
url: string;
}

Expand Down