add option to disable the "Select Media to Download" for embeds (#485)
- Fixes #486 - Adding `nomediadownload` attr, eg. `<replay-web-page nomediadownload ...>` will hide the new option in the main menu. - Add a general EmbedOpts that setting that can be used to configure other embedding options.
This commit is contained in:
@@ -66,6 +66,8 @@ class Embed extends LitElement {
|
||||
@property({ type: Boolean }) noCache = false;
|
||||
@property({ type: Boolean }) hideOffscreen: boolean | undefined;
|
||||
|
||||
@property({ type: Boolean }) noMediaDownload = false;
|
||||
|
||||
@property({ type: Boolean }) useAdblock = false;
|
||||
@property({ type: String }) adblockRulesUrl = DEFAULT_ADBLOCK_FILE;
|
||||
|
||||
@@ -324,6 +326,7 @@ class Embed extends LitElement {
|
||||
swName?: string;
|
||||
ruffle?: "1";
|
||||
adblockUrl?: string;
|
||||
noMediaDownload?: string;
|
||||
} = {
|
||||
source,
|
||||
customColl: this.coll,
|
||||
@@ -365,6 +368,10 @@ class Embed extends LitElement {
|
||||
params.adblockUrl = this.adblockRulesUrl;
|
||||
}
|
||||
|
||||
if (this.noMediaDownload) {
|
||||
params.noMediaDownload = "1";
|
||||
}
|
||||
|
||||
this.paramString = new URLSearchParams(
|
||||
// Converting to unknown here so that we can ignore the URL -> string conversion necessary for the types to work out
|
||||
params as unknown as Record<string, string>,
|
||||
|
||||
Reference in New Issue
Block a user