Skip to content

Conversation

@DocMarty84
Copy link
Contributor

When an iframe contains the sandbox attribute, its value must be exactly allow-scripts in order to enable JavaScript. However, in many cases the attribute has more than one value. Here is an example:1

sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox"

We make the condition more flexible by using contains.

Fixes DocMarty84/miniflutt#30

Footnotes

  1. https://github.com/miniflux/v2/blob/3388f8e376632da49be8d8785422962ba83a8518/internal/reader/sanitizer/sanitizer.go#L238

When an iframe contains the `sandbox` attribute, its value must be
exactly `allow-scripts` in order to enable JavaScript. However, in many
cases the attribute has more than one value. Here is an example:[^1]

```
sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox"
```

We make the condition more flexible by using `contains`.

Fixes DocMarty84/miniflutt#30

[^1]: https://github.com/miniflux/v2/blob/3388f8e376632da49be8d8785422962ba83a8518/internal/reader/sanitizer/sanitizer.go#L238
DocMarty84 added a commit to DocMarty84/miniflutt that referenced this pull request Dec 15, 2024
- Flutter version 3.27.0 on channel stable
- Framework revision 8495dee1fd
- Engine revision 83bacfc525
- Dart version 3.6.0
- DevTools 2.40.2

Apply:
- Sub6Resources/flutter_html#1421
- Sub6Resources/flutter_html#1449
Copy link
Owner

@Sub6Resources Sub6Resources left a comment

Choose a reason for hiding this comment

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

LGTM

@Sub6Resources Sub6Resources merged commit 0661b72 into Sub6Resources:master Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Youtube preview not working

2 participants