Your ROOT_URL in app.ini is unix://git.lalonde.me:3000/ but you are visiting https://git.lalonde.me/matth/subgraph-gnome-shell-extension-tor/commit/94c0c27c25965479eccc9f4eae24f9e313d44220?style=split&whitespace=show-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
26 additions and
14 deletions
@ -4,6 +4,7 @@
const Lang = imports . lang ;
const Lang = imports . lang ;
const St = imports . gi . St ;
const St = imports . gi . St ;
const Main = imports . ui . main ;
const Main = imports . ui . main ;
const Notify = imports . gi . Notify ;
const PanelMenu = imports . ui . panelMenu ;
const PanelMenu = imports . ui . panelMenu ;
const Me = imports . misc . extensionUtils . getCurrentExtension ( ) ;
const Me = imports . misc . extensionUtils . getCurrentExtension ( ) ;
@ -11,8 +12,8 @@ const TorControlClient = Me.imports.tor_control_client.TorControlClient;
const TorIcon = 'tor' ;
const TorIcon = 'tor' ;
let torButton ;
let torButton = null ;
let torControlClient ;
let torControlClient = null ;
const TorButton = new Lang . Class ( {
const TorButton = new Lang . Class ( {
Name : 'TorButton' ,
Name : 'TorButton' ,
@ -43,14 +44,23 @@ function init(extensionMeta) {
}
}
function enable ( ) {
function enable ( ) {
torControlClient = new TorControlClient ( ) ;
try {
torButton = new TorButton ( ) ;
torControlClient = new TorControlClient ( ) ;
Main . panel . addToStatusArea ( torButton . Name , torButton ) ;
torButton = new TorButton ( ) ;
Main . panel . addToStatusArea ( torButton . Name , torButton ) ;
} catch ( e ) {
Main . notifyError ( 'Error starting extension: ' + e ) ;
disable ( ) ;
}
}
}
function disable ( ) {
function disable ( ) {
torButton . destroy ( ) ;
if ( torButton !== null ) {
torButton = null ;
torButton . destroy ( ) ;
torControlClient . close ( ) ;
torButton = null ;
torControlClient = null ;
}
if ( torControlClient !== null ) {
torControlClient . close ( ) ;
torControlClient = null ;
}
}
}
@ -14,15 +14,17 @@ const TorControlClient = new Lang.Class({
} ,
} ,
close : function ( ) {
close : function ( ) {
this . _outputStream . close ( null ) ;
if ( this . _connection . is _connected ( ) ) {
this . _inputStream . close ( null ) ;
this . _outputStream . close ( null ) ;
this . _inputStream . close ( null ) ;
}
} ,
} ,
_connect : function ( ) {
_connect : function ( ) {
var socketClient = new Gio . SocketClient ( ) ;
var socketClient = new Gio . SocketClient ( ) ;
var connection = socketClient . connect _to _host ( '127.0.0.1:9051' , null , null ) ;
this . _ connection = socketClient . connect _to _host ( '127.0.0.1:9051' , null , null ) ;
this . _inputStream = new Gio . DataInputStream ( { base _stream : connection. get _input _stream ( ) } ) ;
this . _inputStream = new Gio . DataInputStream ( { base _stream : this . _ connection. get _input _stream ( ) } ) ;
this . _outputStream = new Gio . DataOutputStream ( { base _stream : connection. get _output _stream ( ) } ) ;
this . _outputStream = new Gio . DataOutputStream ( { base _stream : this . _ connection. get _output _stream ( ) } ) ;
} ,
} ,
_updateProtocolInfo : function ( ) {
_updateProtocolInfo : function ( ) {