summaryrefslogtreecommitdiffstats
path: root/dom/plugins/base/nsIPluginTag.idl
blob: 68f8da1dc8432fb4dfe007ce2797a0b3b7a52873 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

interface nsIURI;

[builtinclass, scriptable, uuid(5daa99d5-265a-4397-b429-c943803e2619)]
interface nsIPluginTag : nsISupports
{
  // enabledState is stored as one of the following as an integer in prefs,
  // so if new states are added, they must not renumber the existing states.
  const unsigned long STATE_DISABLED = 0;
  const unsigned long STATE_CLICKTOPLAY = 1;
  const unsigned long STATE_ENABLED = 2;

  readonly attribute AUTF8String description;
  readonly attribute AUTF8String filename;
  readonly attribute AUTF8String fullpath;
  readonly attribute AUTF8String version;
  readonly attribute AUTF8String name;

  // The 'nice' name of this plugin, e.g. 'flash' 'java'
  readonly attribute AUTF8String niceName;

  /**
   * true only if this plugin is "hardblocked" and cannot be enabled.
   */
  // FIXME-jsplugins QI to fakePluginTag possible
  // FIXME-jsplugins implement missing + tests (whatever that means)
  [infallible]
  readonly attribute boolean blocklisted;

  /**
   * true if the state is non-default and locked, false otherwise.
   */
  [infallible]
  readonly attribute boolean isEnabledStateLocked;

  // If this plugin is capable of being used (not disabled, blocklisted, etc)
  [infallible]
  readonly attribute boolean active;

  // Get a specific nsIBlocklistService::STATE_*
  [infallible]
  readonly attribute unsigned long blocklistState;

  [infallible]
  readonly attribute boolean disabled;
  [infallible]
  readonly attribute boolean clicktoplay;
  [infallible]
  readonly attribute boolean loaded;
  // See the STATE_* values above.
           attribute unsigned long enabledState;

  readonly attribute PRTime lastModifiedTime;

  readonly attribute boolean isFlashPlugin;

  Array<AUTF8String> getMimeTypes();
  Array<AUTF8String> getMimeDescriptions();
  Array<AUTF8String> getExtensions();

  /**
   * An id for this plugin. 0 is a valid id.
   */
  readonly attribute unsigned long id;
};

/**
 * An interface representing a "fake" plugin: one implemented in JavaScript, not
 * as a NPAPI plug-in.  See nsIPluginHost.registerFakePlugin and the
 * documentation for the FakePluginTagInit dictionary.
 */
[builtinclass, scriptable, uuid(6d22c968-226d-4156-b230-da6ad6bbf6e8)]
interface nsIFakePluginTag : nsIPluginTag
{
  /**
   * The URI that should be loaded into the tag (as a frame) to handle the
   * plugin. Note that the original data/src value for the plugin is not loaded
   * and will need to be requested by the handler via XHR or similar if desired.
   */
  readonly attribute nsIURI handlerURI;

  /**
   * Optional script to run in a sandbox when instantiating a plugin. If this
   * value is an empty string then no such script will be run.
   * The script runs in a sandbox with system principal in the process that
   * contains the element that instantiates the plugin (ie the EMBED or OBJECT
   * element). The sandbox global has a 'pluginElement' property that the script
   * can use to access the element that instantiates the plugin.
   */
  readonly attribute AString sandboxScript;
};