Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit be92255

Browse filesBrowse files
committed
fix: enable JavaScript in iframe
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
1 parent 79ec194 commit be92255
Copy full SHA for be92255

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎packages/flutter_html_iframe/lib/iframe_mobile.dart‎

Copy file name to clipboardExpand all lines: packages/flutter_html_iframe/lib/iframe_mobile.dart
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class IframeWidget extends StatelessWidget {
2020

2121
final sandboxMode = extensionContext.attributes["sandbox"];
2222
controller.setJavaScriptMode(
23-
sandboxMode == null || sandboxMode == "allow-scripts"
23+
sandboxMode == null || sandboxMode.contains("allow-scripts")
2424
? JavaScriptMode.unrestricted
2525
: JavaScriptMode.disabled);
2626

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.