# eric6.Helpviewer.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.
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.
connectPage | Public method to allow the GreaseMonkey manager to connect to the page.
containsScript | Public method to check, if the given script exists.
createRequest | Public method to create a request.
disableScript | Public method to disable the given script.
downloadScript | Public method to download a GreaseMonkey script.
enableScript | Public method to enable the given script.
pageLoadStarted | Public slot to handle the start of loading a page.
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(downloader)

Private slot to handle the completion of a script download.

downloader (GreaseMonkeyDownloader)
  reference to the downloader object

#### GreaseMonkeyManager.__load

__load()

Private slot to load the available scripts into the manager.

#### GreaseMonkeyManager.addScript

addScript(script)

Public method to add a script.

script
  script to be added (GreaseMonkeyScript)

Returns:
  flag indicating success (boolean)

#### GreaseMonkeyManager.allScripts

allScripts()

Public method to get a list of all scripts.

Returns:
  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)

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

#### GreaseMonkeyManager.connectPage

connectPage(page)

Public method to allow the GreaseMonkey manager to connect to the page.

page
  reference to the web page (HelpWebPage)

#### GreaseMonkeyManager.containsScript

containsScript(fullName)

Public method to check, if the given script exists.

fullName
  full name of the script (string)

Returns:
  flag indicating the existence (boolean)

#### GreaseMonkeyManager.createRequest

createRequest(op, request, outgoingData=None)

Public method to create a request.

op
  the operation to be performed (QNetworkAccessManager.Operation)
request
  reference to the request object (QNetworkRequest)
outgoingData
  reference to an IODevice containing data to be sent (QIODevice)

Returns:
  reference to the created reply object (QNetworkReply)

#### GreaseMonkeyManager.disableScript

disableScript(script)

Public method to disable the given script.

script
  script to be disabled (GreaseMonkeyScript)

#### GreaseMonkeyManager.downloadScript

downloadScript(request)

Public method to download a GreaseMonkey script.

request
  reference to the request (QNetworkRequest)

#### GreaseMonkeyManager.enableScript

enableScript(script)

Public method to enable the given script.

script
  script to be enabled (GreaseMonkeyScript)

#### GreaseMonkeyManager.pageLoadStarted

pageLoadStarted()

Public slot to handle the start of loading a page.

#### GreaseMonkeyManager.removeScript

removeScript(script)

Public method to remove a script.

script
  script to be removed (GreaseMonkeyScript)

Returns:
  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)

Returns:
  sources of all required scripts (string)

#### GreaseMonkeyManager.requireScriptsDirectory

requireScriptsDirectory()

Public method to get the path of the scripts directory.

Returns:
  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.

Returns:
  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