AlistGo / AlistGo/alist

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

オープン
#7,920 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Go
スター
50.2k
フォーク
7.9k
平均マージ
7日 21時間
マージ済み PR(30日)
6

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。