【Feature Request】希望能够默认给iframe预览加上allowfullscreen属性
- 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
Assessment
This issue has not been assessed yet.