AlistGo / AlistGo/alist

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

Aperta
#7,920 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Go
Stelle
50.2k
Fork
7.9k
Merge medio
7g 21h
PR unite (30g)
6

Descrizione

### 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_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.