Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
flashdetect
Advanced tools
Readme
Tiny (<1K) Adobe Flash® Player detection script distilled from SWFObject
Include or load flashdetect.min.js, then call getFlashVersion()
. This will always return a number:
9.125
or 11.8
-1
This usage allows for easy, clean evaluation, like so:
<script src="js/flashdetect.min.js"></script>
<script>
if( getFlashVersion() >= 9.125 ){
// Flash approach
} else {
// Non-Flash approach
}
</script>
If you roll with the cool kids and use a module loader like requirejs, use the flashdetect.amd.js file. The closure will return a function, so you can just do:
require( ['flashdetect.amd'], function(getFlashVersion){
if( getFlashVersion() >= 9 ){
// Go to town!
}
});
The goal here is reliable and simple cross-browser Flash detection in as little code as possible.
The original detection code comes from SWFObject, a Flash embedding library that's been thoroughly vetted and widely used for years. Really, the SWFObject contributors did most of the hard work here and deserve commensurate credit.
SWFObject's getFlashPlayerVersion()
method returns an object with more detail than is usually needed. Flashdetect always returns a number, so you can more easily pop into an evaluation as described above.
If you're not sure whether a browser supports Flash, you don't want to load a 10k+ (minified!) script just to find out. What's more, we use Flash in different ways than we used to: mostly for polyfills and enhancements like ZeroClipboard. These libraries tend to come with their own streamlined embedding code, and you may not want to load the polyfill unless you know it's supported.
The minified version of this script is about 600 bytes.
Only the vital bits of SWFObject's original detection are retained. Here's what's changed:
testPlayerVersion()
in SWFObject's source for more info.!!
, since all the values are expected as objects.FAQs
Tiny (<1k) Flash detection script distilled from SWFObject
The npm package flashdetect receives a total of 8 weekly downloads. As such, flashdetect popularity was classified as not popular.
We found that flashdetect 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.