AlistGo / AlistGo/alist

【Feature Request】希望能够默认给iframe预览加上allowfullscreen属性

Offen
#7,920 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Go
Sterne
50.2k
Forks
7.9k
Ø Merge
7 T. 21 Std.
Gemergte PRs (30 T.)
6

Beschreibung

### Please make sure of the following things

- [x] I have read the [documentation](https://alist.nn.ci).
- [x] I'm sure there are no duplicate issues or discussions.
- [x] I'm sure this feature is not implemented.
- [x] I'm sure it's a reasonable and popular requirement.

### Description of the feature / 需求描述

希望Iframe预览默认给Iframe加上`allowfullscreen`的Attribute。或者后台设置加个选项也行。

### Suggested solution / 实现思路

非常简单,``

目前的workaround是,在后台自定义内容中用js hook `createElement`方法,但这不是个好方法。

```
<script>
document.createElement = function(create) {
return function() {
var ret = create.apply(this, arguments);
if (ret.tagName.toLowerCase() === "iframe") {
ret.setAttribute("allowfullscreen", "");
}
return ret;
};
}(document.createElement)
</script>
```

### Additional context / 附件

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.