AlistGo / AlistGo/alist

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

Open
#7,920 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
50.2k
Forks
7.9k
Avg merge
7d 21h
Merged PRs (30d)
6

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.