Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
JavaScript WebView detection for Node and the browser.
Sometimes you need to know if a DOM document or an HTTP request is performed by a UIWebView/WebView or not. Especially to serve a more contextualised experience or to dynamically load components.
WebView detection is twofold:
npm install --save is-webview
The library is browserify and webpack friendly. Use them!
var iswebview = require('is-webview');
module.exports = function(req, res, next){
if (iswebview(req.headers['User-Agent'])) {
// set-up whatever is needed for a WebView
// ...
next();
}
};
if (isWebview(navigator.userAgent)) {
// do whatever is needed for a WebView display
// ...
};
iswebview(userAgent)
userAgent
(String): Browser User-Agent header stringDetects a WebView from browser properties (if available) and from a User-Agent string.
if (iswebview(navigator.userAgent)) {
// ...
}
iswebview(userAgent, configObject)
userAgent
(String): Browser User-Agent header stringconfigObject
(Object): see below.Detects a WebView from a custom User-Agent string, browser properties (if available) and fallbacks to regular User-Agent string.
if (iswebview(navigator.userAgent, { appName: 'FooBar' })) {
// ...
}
A configuration object conveys cues to assist the detection:
appName
(String): the app name explicitly set in your WebView properties/settings.Copyright 2014 British Broadcasting Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
JavaScript library to indicate if we are dealing with a WebView or a Web page.
The npm package is-webview receives a total of 285 weekly downloads. As such, is-webview popularity was classified as not popular.
We found that is-webview 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.