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

iOS WebViewConfiguration preferences has many undocumented features #14070

Closed
1 task done
Informate opened this issue Jun 21, 2024 · 6 comments · Fixed by #14072
Closed
1 task done

iOS WebViewConfiguration preferences has many undocumented features #14070

Informate opened this issue Jun 21, 2024 · 6 comments · Fixed by #14072
Labels
bug docs needs triage This issue hasn't been reviewed by maintainers

Comments

@Informate
Copy link

Informate commented Jun 21, 2024

I have searched and made sure there are no existing issues for the issue I am filing

  • I have searched the existing issues

URL

https://titaniumsdk.com/api/structs/webviewpreferencesobject.html

Description

The list of properties for WebView Preferences is highly incomplete.
A full list of the preferences is present at: https://github.com/WebKit/webkit/blob/main/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm

Suggestion

Complete the list or at least add a link and some explanation to WKPreferences.mm where the list is complete.
The functionality already works in titanium if set, as for example does {"webGLEnabled": false}, but are completely undocumented on titanium docs.
Some of the interesting preferences includes (as found in other StackOverflow users issues):
allowFileAccessFromFileURLs and allowUniversalAccessFromFileURLs that are XMLHttpRequest related features especially useful when working with local WebViews.

Link to list: https://github.com/WebKit/webkit/blob/main/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm

@Informate Informate added bug docs needs triage This issue hasn't been reviewed by maintainers labels Jun 21, 2024
@Informate Informate changed the title iOS WebKit WebViewConfiguration preferences inconplete listing in Docs iOS WebViewConfiguration preferences inconplete listing in Docs Jun 21, 2024
@Informate Informate changed the title iOS WebViewConfiguration preferences inconplete listing in Docs iOS WebViewConfiguration preferences has many undocumented features Jun 21, 2024
@m1ga
Copy link
Contributor

m1ga commented Jun 22, 2024

Feel free to create a PR and edit: https://github.com/tidev/titanium-sdk/blob/master/apidoc/Titanium/UI/iOS/WebViewConfiguration.yml to add the link

@Informate
Copy link
Author

I do not know what a PR is, it ask me to fork the entire project. If you can do it for me, I just added a line at the end of the description:

description: |
Use the <Titanium.UI.iOS.createWebViewConfiguration> method to create and use as a parameter of <Titanium.UI.WebView.configuration>.
Using this you can determine how soon a webpage is rendered, how media playback is handled, the granularity of items that the
user can select, and many other options. This property can only be set when creating the webview and will be ignored when set afterwards.

See the example section "Usage of WebViewConfiguration with WebView in iOS".

Information on additional available preferences can be derived from the original WebKit sources: [WKPreferences.mm](https://github.com/WebKit/webkit/blob/main/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm)

@m1ga
Copy link
Contributor

m1ga commented Jun 22, 2024

a PR is a pull request. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request

You fork the project, clone it locally, make the changes, commit the changes and create a PR. The normal github/git way.

But yes, I can do it for you too

@m1ga
Copy link
Contributor

m1ga commented Jun 22, 2024

PR with your link #14072

@Informate
Copy link
Author

Thanks!

@Informate
Copy link
Author

Thanks!
I know you do not like generated code, but it can also extract the entries for iOS:

javaScriptEnabled, javaScriptCanOpenWindowsAutomatically, minimumFontSize, suppressesIncrementalRendering, backspaceKeyNavigationEnabled, tabFocusesLinks, privateBrowsingEnabled, javaScriptMarkupEnabled, hyperlinkAuditingEnabled, offlineWebApplicationCacheEnabled, plugInsEnabled, allowsAnimatedImages, allowsAnimatedImageLooping, loadsImagesAutomatically, autosaves, enablesWebViewDarkMode, mockScrollbarsEnabled, textAreasAreResizable, textTracksEnabled, loadsSiteIconsIgnoringImageLoadingPreference, javaScriptCanAccessClipboard, developerExtrasEnabled, applicationCacheEnabled, javaScriptRuntimeFlags, localStorageEnabled, universalAccessFromFileURLsAllowed, fileAccessFromFileURLsAllowed, fetchAPIKeepAliveEnabled, fetchAPIStreamDataEnabled, contentSecurityPolicyEnabled, contentSecurityPolicyFrameAncestorsEnabled, webGLEnabled, accelerated2DCanvasEnabled, subpixelCSSOMElementMetricsEnabled, mediaDataLoadsAutomatically, backForwardCacheEnabled, suppressesTestingJavaScriptAlerts, linkPrefetchEnabled, networkCacheEnabled, suppressesBackForwardNavigationGestures, canvasUsesAcceleratedDrawing, prefetchDNS, staticDateAndTime, onlineApplicationCacheQuota, privateClickMeasurementEnabled, mediaCaptureRequiresSecureConnection, highPerformanceCanvasRenderingEnabled, screenCaptureRequiresUserGesture, allowsMediaCaptureOnInsecureSites, videoCaptureRequiresSecureConnection, webAudioEnabled, experimentalContentSecurityPolicyEnabled, domTimersThrottlingEnabled, modernMediaControlsEnabled, pictureInPictureEnabled, incrementalRenderingSuppressed, acceleratedCompositingEnabled, scrollAnimatorEnabled, asynchronousPluginInitializationEnabled, asynchronousPluginInitializationEnabledForAllPlugins, asynchronousPluginInitializationEnabledForAppQuirks, pluginProcessesEnabled, plugInSnapshottingEnabled, mediaPlaybackRequiresUserGesture, allowsPictureInPictureMediaPlayback, allowsInlineMediaPlayback, tabFocusesLinksByDefault, mediaDataPreloadingEnabled, allowCrossOriginSubresourcesToAskForCredentials, cacheAPIKeepAliveEnabled, asyncFrameScrollEnabled, zoomsPageToFit, visibleWindowSnapshottedAtBoot, canvasIsAccelerated, mediaControlsScale, mediaPlaybackAllowsInline, audioPlaybackRequiresUserGesture, suppressesIncrementalRendering, downloadsUndecodedImageData, localFileContentSniffingEnabled, pagingEnabled, contentBlockersEnabled, allowsInlineMediaPlaybackInPictureInPicture, shouldRespectImageOrientation, experimentalFeatureEnabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug docs needs triage This issue hasn't been reviewed by maintainers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants