cordova-plugin-safariviewcontroller icon indicating copy to clipboard operation
cordova-plugin-safariviewcontroller copied to clipboard

Feature Request : ability to hide url and show only the web content.

Open T3Z3N opened this issue 5 years ago • 6 comments

can we have the ability to hide url and show only the web content.

T3Z3N avatar Nov 06 '19 07:11 T3Z3N

Can you please apply the following?

let safariViewController = SFSafariViewController(URL: url)
presentViewController(safariViewController, animated: true) {
    var frame = safariViewController.view.frame
    let OffsetY: CGFloat  = 64
    frame.origin = CGPoint(x: frame.origin.x, y: frame.origin.y - OffsetY)
    frame.size = CGSize(width: frame.width, height: frame.height + OffsetY)
    safariViewController.view.frame = frame
}
presentViewController(svc, animated: true) {
    let width: CGFloat = 66
    let x: CGFloat = self.view.frame.width - width

    // It can be any overlay. May be your logo image here inside an imageView.
    let overlay = UIView(frame: CGRect(x: x, y: 20, width: width, height: 44))
    overlay.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.5)
    svc.view.addSubview(overlay)
}

allnash avatar Dec 24 '19 19:12 allnash

@EddyVerbruggen

allnash avatar Dec 24 '19 19:12 allnash

I'd be happy to merge a PR! This looks like Swift, so I can't simply paste that into the project. And you may want to make it configurable through the JS API..

EddyVerbruggen avatar Dec 24 '19 19:12 EddyVerbruggen

True. I am a little rusty on my ObjC. I can attempt it in the next month or so.

allnash avatar Dec 24 '19 20:12 allnash

@EddyVerbruggen was this ever implemented ?

Scobee avatar Sep 21 '20 20:09 Scobee

No

EddyVerbruggen avatar Sep 21 '20 21:09 EddyVerbruggen