# eric7.WebBrowser.GreaseMonkey.GreaseMonkeyManager

Module implementing the manager for GreaseMonkey scripts.

### Global Attributes

None

### Classes

GreaseMonkeyManager | Class implementing the manager for GreaseMonkey scripts.

### Functions

None

## GreaseMonkeyManager

Class implementing the manager for GreaseMonkey scripts.

### Signals

scriptsChanged()
  emitted to indicate a change of scripts

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

GreaseMonkeyManager | Constructor
__downloaderFinished | Private slot to handle the completion of a script download.
__load | Private slot to load the available scripts into the manager.
__scriptChanged | Private slot handling a changed script.
addScript | Public method to add a script.
allScripts | Public method to get a list of all scripts.
canRunOnScheme | Public method to check, if scripts can be run on a scheme.
containsScript | Public method to check, if the given script exists.
disableScript | Public method to disable the given script.
doDownloadScript | Public slot to download a GreaseMonkey script.
downloadScript | Public method to download a GreaseMonkey script.
enableScript | Public method to enable the given script.
removeScript | Public method to remove a script.
requireScripts | Public method to get the sources of all required scripts.
requireScriptsDirectory | Public method to get the path of the scripts directory.
saveConfiguration | Public method to save the configuration.
scriptsDirectory | Public method to get the path of the scripts directory.
showConfigurationDialog | Public method to show the configuration dialog.

### Static Methods

None

#### GreaseMonkeyManager (Constructor)

GreaseMonkeyManager(parent=None)

Constructor

parent
  reference to the parent object (QObject)

#### GreaseMonkeyManager.__downloaderFinished

__downloaderFinished(fileName, downloader)

Private slot to handle the completion of a script download.

fileName (str)
  name of the downloaded script
downloader (GreaseMonkeyDownloader)
  reference to the downloader object

#### GreaseMonkeyManager.__load

__load()

Private slot to load the available scripts into the manager.

#### GreaseMonkeyManager.__scriptChanged

__scriptChanged(script)

Private slot handling a changed script.

script (GreaseMonkeyScript)
  reference to the changed script

#### GreaseMonkeyManager.addScript

addScript(script)

Public method to add a script.

script
  script to be added (GreaseMonkeyScript)

Return:
  flag indicating success (boolean)

#### GreaseMonkeyManager.allScripts

allScripts()

Public method to get a list of all scripts.

Return:
  list of all scripts (list of GreaseMonkeyScript)

#### GreaseMonkeyManager.canRunOnScheme

canRunOnScheme(scheme)

Public method to check, if scripts can be run on a scheme.

scheme
  scheme to check (string)

Return:
  flag indicating, that scripts can be run (boolean)

#### GreaseMonkeyManager.containsScript

containsScript(fullName)

Public method to check, if the given script exists.

fullName
  full name of the script (string)

Return:
  flag indicating the existence (boolean)

#### GreaseMonkeyManager.disableScript

disableScript(script)

Public method to disable the given script.

script
  script to be disabled (GreaseMonkeyScript)

#### GreaseMonkeyManager.doDownloadScript

doDownloadScript(url)

Public slot to download a GreaseMonkey script.

Note: The download needed to be separated in the invoking part (s.a.) and the one doing the real download because the invoking part runs in a different thread (i.e. the web engine thread).

url (QUrl)
  URL to download script from

#### GreaseMonkeyManager.downloadScript

downloadScript(url)

Public method to download a GreaseMonkey script.

url (QUrl)
  URL to download script from

#### GreaseMonkeyManager.enableScript

enableScript(script)

Public method to enable the given script.

script
  script to be enabled (GreaseMonkeyScript)

#### GreaseMonkeyManager.removeScript

removeScript(script, removeFile=True)

Public method to remove a script.

script
  script to be removed (GreaseMonkeyScript)
removeFile
  flag indicating to remove the script file as well (bool)

Return:
  flag indicating success (boolean)

#### GreaseMonkeyManager.requireScripts

requireScripts(urlList)

Public method to get the sources of all required scripts.

urlList
  list of URLs (list of string)

Return:
  sources of all required scripts (string)

#### GreaseMonkeyManager.requireScriptsDirectory

requireScriptsDirectory()

Public method to get the path of the scripts directory.

Return:
  path of the scripts directory (string)

#### GreaseMonkeyManager.saveConfiguration

saveConfiguration()

Public method to save the configuration.

#### GreaseMonkeyManager.scriptsDirectory

scriptsDirectory()

Public method to get the path of the scripts directory.

Return:
  path of the scripts directory (string)

#### GreaseMonkeyManager.showConfigurationDialog

showConfigurationDialog(parent=None)

Public method to show the configuration dialog.

parent
  reference to the parent widget (QWidget)

Up