
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
cordova-plugin-ortoo-safariviewcontroller
Advanced tools
Forget InAppBrowser for iOS - this is way better for displaying read-only web content in your PhoneGap app.
by Eddy Verbruggen - @eddyverbruggen
Note that I didn't decide to clobber window.open to override InAppBrowser when applicable because that would mean you could never use InAppBrowser in case you need its advanced features in one place and are happy with a simple readonly view in other cases.
As you can see from these shots: you can preload a page in reader mode or normal mode, and Safari gives you the option to use the share sheet!
Pressing 'Done' returns the user to your app as you'd expect.
To install the plugin with the Cordova CLI from npm:
$ cordova plugin add cordova-plugin-safariviewcontroller
Since SafariViewController is new in iOS9 you need to have a fallback for older versions (and other platforms),
so if available
returns false (see the snippet below) you want to open the URL in the InAppBrowser probably,
so be sure to include that plugin as well:
$ cordova plugin add cordova-plugin-inappbrowser
I'm not including it as a depency as not all folks may have this requirement.
Check the demo code for an easy to drop in example, otherwise copy-paste this:
function openUrl(url, readerMode) {
SafariViewController.isAvailable(function (available) {
if (available) {
SafariViewController.show({
url: url,
hidden: false, // default false. You can use this to load cookies etc in the background (see issue #1 for details).
animated: false, // default true, note that 'hide' will reuse this preference (the 'Done' button will always animate though)
transition: 'curl', // unless animated is false you can choose from: curl, flip, fade, slide (default)
enterReaderModeIfAvailable: readerMode // default false
},
// this success handler will be invoked for the lifecycle events 'opened', 'loaded' and 'closed'
function(result) {
if (result.event === 'opened') {
alert('opened');
} else if (result.event === 'loaded') {
alert('loaded');
} else if (result.event === 'closed') {
alert('closed');
}
},
function(msg) {
alert("KO: " + msg);
})
} else {
// potentially powered by InAppBrowser because that (currently) clobbers window.open
window.open(url, '_blank', 'location=yes');
}
})
}
function dismissSafari() {
SafariViewController.hide()
}
SFSafariViewController
.cordova-plugin-inappbrowser
is affected by ATS, this plugin is not. This means you can even load http
URL's without whitelisting them.hidden
property to show
.isAvailable
plays nice with non-iOS platforms. Added a transition
property to show
.show
, and added the animated
property to show
.FAQs
Forget InAppBrowser for iOS - this is way better for displaying read-only web content in your PhoneGap app.
The npm package cordova-plugin-ortoo-safariviewcontroller receives a total of 3 weekly downloads. As such, cordova-plugin-ortoo-safariviewcontroller popularity was classified as not popular.
We found that cordova-plugin-ortoo-safariviewcontroller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.