Skip to content
secretrobotron edited this page Dec 10, 2012 · 3 revisions

#Page (Module)

Exposes some page manipulation and information gathering functionality to Butter.

Usage:

var Page = require('path/to/module/page.js');

##Page::addPlayerType (public Member Function)

Loads a specific type of Popcorn player.

  • type [ String ]: Popcorn player type.
  • callback [ Function ]: Callback to execute when loading has finished.

Usage:

p.addPlayerType(type, callback);

##Page::prepare (public Member Function)

Loads the assets required to make Popcorn work as expected for Butter.

  • readyCallback [ Function ]: Callback to execute when loading has finished.

Usage:

p.prepare(readyCallback);

##Page::scrape (public Member Function)

Scrapes the page to look for elements marked as targets or medias.

@return [ Object ]: A collection of media and target elements.

Usage:

p.scrape();
Clone this wiki locally