<p>I have a greasemonkey user script with this single line of code...</p>

<pre><code>window.close();
</code></pre>

<p>but firefox does not allow a user script to close a window (as reported by an error message in the error console)</p>

<p>Is there a work around to this problem?</p>

You need to change configuration settings of Firefox (about:config) to allow this.
Steps:
Go to address bar and type
about:config
Go to parameter
dom.allow_scripts_to_close_windows
Set its value as
true
Now your script can close the TAB with 'window.close()'
eg.
```
```
function closeTab(){
    window.open('', '_self', '');
    window.close();
}
```
```