NPAPI:CancelSourceStream

From MozillaWiki
Jump to: navigation, search

Status

Accepted, ready for implementation. Assigned NPAPI version 24.

Problem Summary

Plugins that do their own data loading should be able to prohibit the browser from loading data from the URL specified in the "src" attribute.

Specification

Cancel Source Stream Support

  • Last modified: January 16, 2009
  • Author: Anders Carlsson (Apple)
  • Contributors: Eric Carlson (Apple), Kevin Decker (Apple)

Before the browser tries to load the stream for the "src" attribute, it will call NPP_GetValue for "NPPVpluginCancelSrcStream" (assigned enum value 20), passing a pointer to an NPBool as the value.

If the plug-in returns an error or sets the pointed to value to false, the stream will be loaded. If the plug-in sets the pointed to vale to true, the stream will not be loaded.

For full-frame plug-ins, where a load has already started, the browser will cancel the load if the plug-in indicates that the src stream should be skipped.