Documentation/Source/eric6.WebBrowser.GreaseMonkey.GreaseMonkeyManager.html

Tue, 25 Apr 2017 19:20:18 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 25 Apr 2017 19:20:18 +0200
changeset 5715
cbcca230679f
parent 4918
71caf42a13d8
child 5716
27a7c7064686
permissions
-rw-r--r--

Updated the GreaseMonkey handler to better work with QWebEngine as of Qt 5.8.0.

<!DOCTYPE html>
<html><head>
<title>eric6.WebBrowser.GreaseMonkey.GreaseMonkeyManager</title>
<meta charset="UTF-8">
<style>
body {
    background: #EDECE6;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #85774A; }
h2 { color: white; background: #85774A; }
h3 { color: white; background: #9D936E; }
h4 { color: white; background: #9D936E; }
    
a { color: #BA6D36; }

</style>
</head>
<body><a NAME="top" ID="top"></a>
<h1>eric6.WebBrowser.GreaseMonkey.GreaseMonkeyManager</h1>
<p>
Module implementing the manager for GreaseMonkey scripts.
</p>
<h3>Global Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Classes</h3>
<table>
<tr>
<td><a href="#GreaseMonkeyManager">GreaseMonkeyManager</a></td>
<td>Class implementing the manager for GreaseMonkey scripts.</td>
</tr>
</table>
<h3>Functions</h3>
<table>
<tr><td>None</td></tr>
</table>
<hr /><hr />
<a NAME="GreaseMonkeyManager" ID="GreaseMonkeyManager"></a>
<h2>GreaseMonkeyManager</h2>
<p>
    Class implementing the manager for GreaseMonkey scripts.
</p>
<h3>Derived from</h3>
QObject
<h3>Class Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>
<table>
<tr>
<td><a href="#GreaseMonkeyManager.__init__">GreaseMonkeyManager</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.__del__">__del__</a></td>
<td>Special method called during object destruction.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.__downloaderFinished">__downloaderFinished</a></td>
<td>Private slot to handle the completion of a script download.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.__load">__load</a></td>
<td>Private slot to load the available scripts into the manager.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.__scriptChanged">__scriptChanged</a></td>
<td>Private slot handling a changed script.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.addScript">addScript</a></td>
<td>Public method to add a script.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.allScripts">allScripts</a></td>
<td>Public method to get a list of all scripts.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.canRunOnScheme">canRunOnScheme</a></td>
<td>Public method to check, if scripts can be run on a scheme.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.containsScript">containsScript</a></td>
<td>Public method to check, if the given script exists.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.disableScript">disableScript</a></td>
<td>Public method to disable the given script.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.doDownloadScript">doDownloadScript</a></td>
<td>Public slot to download a GreaseMonkey script.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.downloadScript">downloadScript</a></td>
<td>Public method to download a GreaseMonkey script.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.enableScript">enableScript</a></td>
<td>Public method to enable the given script.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.removeScript">removeScript</a></td>
<td>Public method to remove a script.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.requireScripts">requireScripts</a></td>
<td>Public method to get the sources of all required scripts.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.requireScriptsDirectory">requireScriptsDirectory</a></td>
<td>Public method to get the path of the scripts directory.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.saveConfiguration">saveConfiguration</a></td>
<td>Public method to save the configuration.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.scriptsDirectory">scriptsDirectory</a></td>
<td>Public method to get the path of the scripts directory.</td>
</tr><tr>
<td><a href="#GreaseMonkeyManager.showConfigurationDialog">showConfigurationDialog</a></td>
<td>Public method to show the configuration dialog.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="GreaseMonkeyManager.__init__" ID="GreaseMonkeyManager.__init__"></a>
<h4>GreaseMonkeyManager (Constructor)</h4>
<b>GreaseMonkeyManager</b>(<i>parent=None</i>)
<p>
        Constructor
</p><dl>
<dt><i>parent</i></dt>
<dd>
reference to the parent object (QObject)
</dd>
</dl><a NAME="GreaseMonkeyManager.__del__" ID="GreaseMonkeyManager.__del__"></a>
<h4>GreaseMonkeyManager.__del__</h4>
<b>__del__</b>(<i></i>)
<p>
        Special method called during object destruction.
</p><a NAME="GreaseMonkeyManager.__downloaderFinished" ID="GreaseMonkeyManager.__downloaderFinished"></a>
<h4>GreaseMonkeyManager.__downloaderFinished</h4>
<b>__downloaderFinished</b>(<i>fileName</i>)
<p>
        Private slot to handle the completion of a script download.
</p><dl>
<dt><i>fileName</i> (str)</dt>
<dd>
name of the downloaded script
</dd>
</dl><a NAME="GreaseMonkeyManager.__load" ID="GreaseMonkeyManager.__load"></a>
<h4>GreaseMonkeyManager.__load</h4>
<b>__load</b>(<i></i>)
<p>
        Private slot to load the available scripts into the manager.
</p><a NAME="GreaseMonkeyManager.__scriptChanged" ID="GreaseMonkeyManager.__scriptChanged"></a>
<h4>GreaseMonkeyManager.__scriptChanged</h4>
<b>__scriptChanged</b>(<i></i>)
<p>
        Private slot handling a changed script.
</p><a NAME="GreaseMonkeyManager.addScript" ID="GreaseMonkeyManager.addScript"></a>
<h4>GreaseMonkeyManager.addScript</h4>
<b>addScript</b>(<i>script</i>)
<p>
        Public method to add a script.
</p><dl>
<dt><i>script</i></dt>
<dd>
script to be added (GreaseMonkeyScript)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
flag indicating success (boolean)
</dd>
</dl><a NAME="GreaseMonkeyManager.allScripts" ID="GreaseMonkeyManager.allScripts"></a>
<h4>GreaseMonkeyManager.allScripts</h4>
<b>allScripts</b>(<i></i>)
<p>
        Public method to get a list of all scripts.
</p><dl>
<dt>Returns:</dt>
<dd>
list of all scripts (list of GreaseMonkeyScript)
</dd>
</dl><a NAME="GreaseMonkeyManager.canRunOnScheme" ID="GreaseMonkeyManager.canRunOnScheme"></a>
<h4>GreaseMonkeyManager.canRunOnScheme</h4>
<b>canRunOnScheme</b>(<i>scheme</i>)
<p>
        Public method to check, if scripts can be run on a scheme.
</p><dl>
<dt><i>scheme</i></dt>
<dd>
scheme to check (string)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
flag indicating, that scripts can be run (boolean)
</dd>
</dl><a NAME="GreaseMonkeyManager.containsScript" ID="GreaseMonkeyManager.containsScript"></a>
<h4>GreaseMonkeyManager.containsScript</h4>
<b>containsScript</b>(<i>fullName</i>)
<p>
        Public method to check, if the given script exists.
</p><dl>
<dt><i>fullName</i></dt>
<dd>
full name of the script (string)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
flag indicating the existence (boolean)
</dd>
</dl><a NAME="GreaseMonkeyManager.disableScript" ID="GreaseMonkeyManager.disableScript"></a>
<h4>GreaseMonkeyManager.disableScript</h4>
<b>disableScript</b>(<i>script</i>)
<p>
        Public method to disable the given script.
</p><dl>
<dt><i>script</i></dt>
<dd>
script to be disabled (GreaseMonkeyScript)
</dd>
</dl><a NAME="GreaseMonkeyManager.doDownloadScript" ID="GreaseMonkeyManager.doDownloadScript"></a>
<h4>GreaseMonkeyManager.doDownloadScript</h4>
<b>doDownloadScript</b>(<i>url</i>)
<p>
        Public slot to download a GreaseMonkey script.
</p><p>
        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).
</p><dl>
<dt><i>url</i> (QUrl)</dt>
<dd>
URL to download script from
</dd>
</dl><a NAME="GreaseMonkeyManager.downloadScript" ID="GreaseMonkeyManager.downloadScript"></a>
<h4>GreaseMonkeyManager.downloadScript</h4>
<b>downloadScript</b>(<i>url</i>)
<p>
        Public method to download a GreaseMonkey script.
</p><dl>
<dt><i>url</i> (QUrl)</dt>
<dd>
URL to download script from
</dd>
</dl><a NAME="GreaseMonkeyManager.enableScript" ID="GreaseMonkeyManager.enableScript"></a>
<h4>GreaseMonkeyManager.enableScript</h4>
<b>enableScript</b>(<i>script</i>)
<p>
        Public method to enable the given script.
</p><dl>
<dt><i>script</i></dt>
<dd>
script to be enabled (GreaseMonkeyScript)
</dd>
</dl><a NAME="GreaseMonkeyManager.removeScript" ID="GreaseMonkeyManager.removeScript"></a>
<h4>GreaseMonkeyManager.removeScript</h4>
<b>removeScript</b>(<i>script, removeFile=True</i>)
<p>
        Public method to remove a script.
</p><dl>
<dt><i>script</i></dt>
<dd>
script to be removed (GreaseMonkeyScript)
</dd><dt><i>removeFile</i></dt>
<dd>
flag indicating to remove the script file as well
            (bool)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
flag indicating success (boolean)
</dd>
</dl><a NAME="GreaseMonkeyManager.requireScripts" ID="GreaseMonkeyManager.requireScripts"></a>
<h4>GreaseMonkeyManager.requireScripts</h4>
<b>requireScripts</b>(<i>urlList</i>)
<p>
        Public method to get the sources of all required scripts.
</p><dl>
<dt><i>urlList</i></dt>
<dd>
list of URLs (list of string)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
sources of all required scripts (string)
</dd>
</dl><a NAME="GreaseMonkeyManager.requireScriptsDirectory" ID="GreaseMonkeyManager.requireScriptsDirectory"></a>
<h4>GreaseMonkeyManager.requireScriptsDirectory</h4>
<b>requireScriptsDirectory</b>(<i></i>)
<p>
        Public method to get the path of the scripts directory.
</p><dl>
<dt>Returns:</dt>
<dd>
path of the scripts directory (string)
</dd>
</dl><a NAME="GreaseMonkeyManager.saveConfiguration" ID="GreaseMonkeyManager.saveConfiguration"></a>
<h4>GreaseMonkeyManager.saveConfiguration</h4>
<b>saveConfiguration</b>(<i></i>)
<p>
        Public method to save the configuration.
</p><a NAME="GreaseMonkeyManager.scriptsDirectory" ID="GreaseMonkeyManager.scriptsDirectory"></a>
<h4>GreaseMonkeyManager.scriptsDirectory</h4>
<b>scriptsDirectory</b>(<i></i>)
<p>
        Public method to get the path of the scripts directory.
</p><dl>
<dt>Returns:</dt>
<dd>
path of the scripts directory (string)
</dd>
</dl><a NAME="GreaseMonkeyManager.showConfigurationDialog" ID="GreaseMonkeyManager.showConfigurationDialog"></a>
<h4>GreaseMonkeyManager.showConfigurationDialog</h4>
<b>showConfigurationDialog</b>(<i>parent=None</i>)
<p>
        Public method to show the configuration dialog.
</p><dl>
<dt><i>parent</i></dt>
<dd>
reference to the parent widget (QWidget)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial