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

fix(pages): script tags can now be executed if they are provided through advanced settings #4824

Merged
merged 4 commits into from
Mar 11, 2025

Conversation

jelmerveen
Copy link
Collaborator

What are the main changes you did

  • explain what you changed and essential considerations.
    I changed the v-html implementation to parsing the string as DOM elements, adding them to the page. For script tags I created new script tags, so they will execute once loaded. v-html uses innerHTML under the hood. That disables any execution.

How to test

  • explain here what to do to test this (or point to unit tests)

Edit a page in advanced settings and add a script tag, example <script>alert("!")</script>, this will trigger when parsed.
You can ofcourse use window.onload or such, to await execution until page has been loaded

Partially implements #4606

Checklist

  • updated docs in case of new feature
  • added/updated tests
  • added/updated testplan to include a test for this fix, including ref to bug using # notation

@jelmerveen jelmerveen added the bug Something isn't working label Mar 11, 2025
@jelmerveen jelmerveen requested a review from MaxPostema March 11, 2025 13:43
@jelmerveen jelmerveen self-assigned this Mar 11, 2025
Copy link
Member

@mswertz mswertz left a comment

Choose a reason for hiding this comment

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

nice.

@jelmerveen jelmerveen merged commit dc23ab7 into master Mar 11, 2025
6 of 7 checks passed
@jelmerveen jelmerveen deleted the fix/pages-enable-javascript branch March 11, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants