packages icon indicating copy to clipboard operation
packages copied to clipboard

[webview_flutter_web] Add the credentialless iframe attribute.

Open uldall opened this issue 1 year ago • 10 comments
trafficstars

This PR makes it possible to specify whether the <iframe> should have the attribute credentialless set to true or false.

  • https://github.com/flutter/flutter/issues/151557

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

uldall avatar Jul 10 '24 19:07 uldall

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

flutter-dashboard[bot] avatar Jul 10 '24 19:07 flutter-dashboard[bot]

Example usage:

late final PlatformWebViewControllerCreationParams params;
if (WebViewPlatform.instance is WebWebViewPlatform) {
  params = WebWebViewControllerCreationParams(
    iFrameCredentialless: true,
  );
} else {
  params = const PlatformWebViewControllerCreationParams();
}

_webViewController = WebViewController.fromPlatformCreationParams(params);

uldall avatar Jul 10 '24 19:07 uldall

Example of how it looks when the attribute is added: image

uldall avatar Jul 10 '24 19:07 uldall

Thanks for the contribution! You’ve checked boxes in the PR checklist above that are not reflected in this PR, so I’m assuming this is a work in progress and am marking it as a Draft. Please review the checklist, updating the PR as appropriate, and when the checklist reflects the state of the PR as posted please feel free to mark it as ready for review.

stuartmorgan-g avatar Jul 10 '24 21:07 stuartmorgan-g

Thanks for the contribution! You’ve checked boxes in the PR checklist above that are not reflected in this PR, so I’m assuming this is a work in progress and am marking it as a Draft. Please review the checklist, updating the PR as appropriate, and when the checklist reflects the state of the PR as posted please feel free to mark it as ready for review.

I have added tests and comments now. I am not sure about whether I am supposed to update the pubspec.yaml and CHANGELOG.md? Sorry about the potentially stupid question. This is my first PR on the Flutter project.

uldall avatar Jul 11 '24 17:07 uldall

Would it be preferable if I changed this PR to use a Map<String, String> of attributes instead so it became more generic?

uldall avatar Jul 20 '24 06:07 uldall

From triage: Ping @ditman on the design question above.

stuartmorgan-g avatar Aug 06 '24 19:08 stuartmorgan-g

Would it be preferable if I changed this PR to use a Map<String, String> of attributes instead so it became more generic?

@uldall I think it's better that we do this using the type safety of Dart and package:web rather than a stringly typed map :)

(PS: credentialless is only supported in Chrome browsers for now, we may need to add a note to the parameter itself so users are aware of this limitation?)

ditman avatar Sep 10 '24 21:09 ditman

@uldall Are you still planning on updating this PR based on the feedback above?

stuartmorgan-g avatar Oct 01 '24 19:10 stuartmorgan-g

I am not sure why GitHub closed my PR just because I updated my fork..

uldall avatar Oct 13 '24 12:10 uldall

Since this is marked as a draft and hasn't been updated in several months, I’m going to close it so that our PR queue reflects active PRs. Please don't hesitate to submit a new PR if you decide to revisit this. Thanks!

stuartmorgan-g avatar Dec 03 '24 20:12 stuartmorgan-g