Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 tasks done
StackExplode opened this issue Feb 1, 2025 · 1 comment
Open
4 tasks done
Labels
enhancement New feature or request

Comments

@StackExplode
Copy link

Please make sure of the following things

  • I have read the documentation.
  • I'm sure there are no duplicate issues or discussions.
  • I'm sure this feature is not implemented.
  • I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

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

Suggested solution / 实现思路

非常简单,<iframe allowfullscreen src="...">

目前的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

@StackExplode StackExplode added the enhancement New feature or request label Feb 1, 2025
Copy link

github-actions bot commented Feb 1, 2025

@StackExplode StackExplode changed the title 【Feature Request】希望能够默认给iframe预览 【Feature Request】希望能够默认给iframe预览加上allowfullscreen属性 Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant