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

Initial support for allowing plugins to modify the Webview Configuration #2028

Closed
wants to merge 1 commit into from

Conversation

macdja38
Copy link
Contributor

@macdja38 macdja38 commented Oct 4, 2019

Solves #1097

Allows a plugin to modify the WKWebViewConfiguration as follows:

import Foundation
import Capacitor

@objc(IgnoreViewPortScaleLimitsPlugin)
public class IgnoreViewPortScaleLimitsPlugin: CAPPlugin {
    public static override func configureWKWebView(configuration: WKWebViewConfiguration) {
        configuration.ignoresViewportScaleLimits = true
    }
}

Drawbacks at the moment is nothing stops two conflicting modifications from conflicting, no simple way of warning the user that a plugin is overwriting another plugin, not sure if plugins are loaded consistently so it's hard to say if things will fail in consistent ways.

Not sure where to document this, seems it should be documented in the same place as load but I can't find where load is documented… Maybe It should be here? https://capacitor.ionicframework.com/docs/plugins/ios But that's a guide not really documentation…

If someone from the capacitor team could let me know where to document it along with if they're interested in merging this / know of a better way to go about this please let me know then I'll finish it up and remove the draft status.

@eliellis
Copy link

eliellis commented Mar 7, 2020

I’m currently experiencing an issue that could be totally fixed by this! If anyone from the team could respond to this that’d be awesome.

@skyleguy
Copy link

skyleguy commented Mar 9, 2020

would love if the ignoresViewportScaleLimits field was configurable from my codebase!

@jcesarmobile jcesarmobile added needs discussion decisions must be made before working on it and removed needs reply needs reply from the user labels May 5, 2020
@imhoffd
Copy link
Contributor

imhoffd commented Jun 30, 2020

Thanks for the PR! This doesn't feel like the right way to solve this use case. We'd be open to looking at a PR that adds a configuration value for Capacitor that would alter ignoresViewportScaleLimits in WKWebView, but maybe it's best to wait. We're about to start major refactors for Capacitor 3.

I created #3179 to track this.

@imhoffd imhoffd closed this Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs discussion decisions must be made before working on it platform: ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants