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

Avoid showing unnecessary JS errors when there are elements with different origin on the page #29081

Merged
merged 4 commits into from
Feb 8, 2024

Conversation

wxiaoguang
Copy link
Contributor

Try to fix #29080

@wxiaoguang wxiaoguang added this to the 1.22.0 milestone Feb 7, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 7, 2024
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 7, 2024
@wxiaoguang wxiaoguang added the backport/v1.21 This PR should be backported to Gitea 1.21 label Feb 7, 2024
return false;
}
}

Copy link
Member

@silverwind silverwind Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we detect the iframe document via el.ownerDocument !== document and ignore those? I don't think we want to run the mutation callbacks on any iframe content (mermaid and user-configured renderers are the only cases I know of).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 6299b57 , and added more comments

Copy link
Member

@silverwind silverwind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is fine as-is, so above comment is an optional enhancement.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 7, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 8, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 8, 2024
@lunny lunny enabled auto-merge (squash) February 8, 2024 02:34
@lunny lunny merged commit f290c24 into go-gitea:main Feb 8, 2024
25 checks passed
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Feb 8, 2024
@GiteaBot GiteaBot added backport/done All backports for this PR have been created and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels Feb 8, 2024
@wxiaoguang wxiaoguang deleted the fix-sop-js-error branch February 8, 2024 02:44
wxiaoguang added a commit that referenced this pull request Feb 8, 2024
…erent origin on the page (#29081) (#29089)

Backport #29081 by wxiaoguang

Try to fix #29080

Co-authored-by: wxiaoguang <[email protected]>
silverwind pushed a commit to silverwind/gitea that referenced this pull request Feb 20, 2024
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Feb 26, 2024
…ith different origin on the page (go-gitea#29081)

Try to fix go-gitea#29080

(cherry picked from commit f290c24)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/v1.21 This PR should be backported to Gitea 1.21 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Javascript error: same origin policy
4 participants