Git Product home page Git Product logo

phantomjs-flash's Introduction

PhantomJs Flash faker

PhantomJS-Flash is a small snippet for faking Flash support inside PhantomJS. It works by overriding the navigator object (although all of its properties remain untouched), and faking the mimeTypes and plugins object. This will cause libraries like SWFObject to think that Flash support is available.

Usage

You only need to call the flash method in the onInitialized callback, passing the page object to the function. As a result you will get a boolean value, indicating if the process went well or not. This will let you bypass the flash detections, although it will not fake a real Flash object. If you need real Flash support, you should use a solution like the Ryan Bridges one.

Example

"use strict";

var webpage = require('webpage');
var flash = require('./flash');
var page = webpage.create();

page.onInitialized = function() {
    console.log('Flash successfully faked: ' + flash(page));
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.