# eric7.WebBrowser.GreaseMonkey.GreaseMonkeyScript

Module implementing the GreaseMonkey script.

### Global Attributes

None

### Classes

GreaseMonkeyScript | Class implementing the GreaseMonkey script.
GreaseMonkeyScriptStartPoint | Class defining the script start points.

### Functions

None

## GreaseMonkeyScript

Class implementing the GreaseMonkey script.

### Signals

scriptChanged()
  emitted to indicate a script change
updatingChanged(bool)
  emitted to indicate a change of the updating state

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

GreaseMonkeyScript | Constructor
__downloadIcon | Private slot to download the script icon.
__downloadRequires | Private method to download the required scripts.
__downloaderError | Private slot to handle a downloader error.
__downloaderFinished | Private slot to handle a finished download.
__iconDownloaded | Private slot to handle a finished download of a script icon.
__parseScript | Private method to parse the given script and populate the data structure.
__reloadScript | Private method to reload the script.
__requireDownloadError | Private slot to handle a downloader error.
__requireDownloaded | Private slot to handle a finished download of a required script.
__watchedFileChanged | Private slot handling changes of the script file.
description | Public method to get the description of the script.
downloadUrl | Public method to get the download URL of the script.
exclude | Public method to get the list of excluded URLs.
fileName | Public method to get the path of the Javascript file.
fullName | Public method to get the full name of the script.
icon | Public method to get the icon of the script.
iconUrl | Public method to get the icon URL of the script.
include | Public method to get the list of included URLs.
isEnabled | Public method to check, if the script is enabled.
isUpdating | Public method to get the updating flag.
isValid | Public method to check the validity of the script.
name | Public method to get the name of the script.
nameSpace | Public method to get the name space of the script.
noFrames | Public method to get the noFrames flag.
require | Public method to get the list of required scripts.
setEnabled | Public method to enable a script.
startAt | Public method to get the start point of the script.
updateScript | Public method to updated the script.
updateUrl | Public method to get the update URL of the script.
version | Public method to get the version of the script.
webScript | Public method to create a script object.

### Static Methods

None

#### GreaseMonkeyScript (Constructor)

GreaseMonkeyScript(manager, path)

Constructor

manager (GreaseMonkeyManager)
  reference to the manager object
path (str)
  path of the Javascript file

#### GreaseMonkeyScript.__downloadIcon

__downloadIcon()

Private slot to download the script icon.

#### GreaseMonkeyScript.__downloadRequires

__downloadRequires()

Private method to download the required scripts.

#### GreaseMonkeyScript.__downloaderError

__downloaderError(downloader)

Private slot to handle a downloader error.

downloader (GreaseMonkeyDownloader)
  reference to the downloader object

#### GreaseMonkeyScript.__downloaderFinished

__downloaderFinished(downloader)

Private slot to handle a finished download.

downloader (GreaseMonkeyDownloader)
  reference to the downloader object

#### GreaseMonkeyScript.__iconDownloaded

__iconDownloaded(reply)

Private slot to handle a finished download of a script icon.

reply (QNetworkReply)
  reference to the network reply

#### GreaseMonkeyScript.__parseScript

__parseScript()

Private method to parse the given script and populate the data structure.

#### GreaseMonkeyScript.__reloadScript

__reloadScript()

Private method to reload the script.

#### GreaseMonkeyScript.__requireDownloadError

__requireDownloadError(downloader)

Private slot to handle a downloader error.

downloader (GreaseMonkeyDownloader)
  reference to the downloader object

#### GreaseMonkeyScript.__requireDownloaded

__requireDownloaded(downloader)

Private slot to handle a finished download of a required script.

downloader (GreaseMonkeyDownloader)
  reference to the downloader object

#### GreaseMonkeyScript.__watchedFileChanged

__watchedFileChanged(fileName)

Private slot handling changes of the script file.

fileName (str)
  path of the script file

#### GreaseMonkeyScript.description

description()

Public method to get the description of the script.

Return:
  description of the script

Return Type:
  str

#### GreaseMonkeyScript.downloadUrl

downloadUrl()

Public method to get the download URL of the script.

Return:
  download URL of the script

Return Type:
  QUrl

#### GreaseMonkeyScript.exclude

exclude()

Public method to get the list of excluded URLs.

Return:
  list of excluded URLs

Return Type:
  list of str

#### GreaseMonkeyScript.fileName

fileName()

Public method to get the path of the Javascript file.

Return:
  path of the Javascript file

Return Type:
  str

#### GreaseMonkeyScript.fullName

fullName()

Public method to get the full name of the script.

Return:
  full name of the script

Return Type:
  str

#### GreaseMonkeyScript.icon

icon()

Public method to get the icon of the script.

Return:
  script icon

Return Type:
  QIcon

#### GreaseMonkeyScript.iconUrl

iconUrl()

Public method to get the icon URL of the script.

Return:
  icon URL of the script

Return Type:
  QUrl

#### GreaseMonkeyScript.include

include()

Public method to get the list of included URLs.

Return:
  list of included URLs

Return Type:
  list of str

#### GreaseMonkeyScript.isEnabled

isEnabled()

Public method to check, if the script is enabled.

Return:
  flag indicating an enabled state

Return Type:
  bool

#### GreaseMonkeyScript.isUpdating

isUpdating()

Public method to get the updating flag.

Return:
  updating flag

Return Type:
  bool

#### GreaseMonkeyScript.isValid

isValid()

Public method to check the validity of the script.

Return:
  flag indicating a valid script

Return Type:
  bool

#### GreaseMonkeyScript.name

name()

Public method to get the name of the script.

Return:
  name of the script

Return Type:
  str

#### GreaseMonkeyScript.nameSpace

nameSpace()

Public method to get the name space of the script.

Return:
  name space of the script

Return Type:
  str

#### GreaseMonkeyScript.noFrames

noFrames()

Public method to get the noFrames flag.

Return:
  flag indicating to not run on sub frames

Return Type:
  bool

#### GreaseMonkeyScript.require

require()

Public method to get the list of required scripts.

Return:
  list of required scripts

Return Type:
  list of str

#### GreaseMonkeyScript.setEnabled

setEnabled(enable)

Public method to enable a script.

enable (bool)
  flag indicating the new enabled state

#### GreaseMonkeyScript.startAt

startAt()

Public method to get the start point of the script.

Return:
  start point of the script

Return Type:
  GreaseMonkeyScriptStartPoint

#### GreaseMonkeyScript.updateScript

updateScript()

Public method to updated the script.

#### GreaseMonkeyScript.updateUrl

updateUrl()

Public method to get the update URL of the script.

Return:
  update URL of the script

Return Type:
  QUrl

#### GreaseMonkeyScript.version

version()

Public method to get the version of the script.

Return:
  version of the script

Return Type:
  str

#### GreaseMonkeyScript.webScript

webScript()

Public method to create a script object.

Return:
  prepared script object

Return Type:
  QWebEngineScript

Up

## GreaseMonkeyScriptStartPoint

Class defining the script start points.

### Derived from

enum.Enum

### Class Attributes

DocumentEnd
DocumentIdle
DocumentStart

### Class Methods

None

### Methods

None

### Static Methods

None

Up