Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ WebInspector.ExtensionPanel = function(id, label, iconURL, options)
this.toolbarItemLabel = label;
this._addStyleRule(".toolbar-item." + id + " .toolbar-icon", "background-image: url(" + iconURL + ");");
WebInspector.Panel.call(this, id);
this._initialize(options);
}

WebInspector.ExtensionPanel.prototype = {
Expand Down Expand Up @@ -76,7 +77,19 @@ WebInspector.ExtensionPanel.prototype = {
var style = document.createElement("style");
style.textContent = selector + " { " + body + " }";
document.head.appendChild(style);
}
},

_initialize: function (options)
{
var aardwolfIP = options.ip,
iframe = document.createElement('iframe');

iframe.src = "http://" + aardwolfIP + ":8501/ui/index.html";
iframe.style.width = "100%";
iframe.style.height = "100%";

this.element.appendChild(iframe);
}
}

WebInspector.ExtensionPanel.prototype.__proto__ = WebInspector.Panel.prototype;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<link rel="stylesheet" type="text/css" href="helpScreen.css">
<link rel="stylesheet" type="text/css" href="popover.css">
<link rel="stylesheet" type="text/css" href="textViewer.css">
<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="utilities.js"></script>
<script type="text/javascript" src="treeoutline.js"></script>
<script type="text/javascript" src="inspector.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ var WebInspector = {
this.panels.audits = new WebInspector.AuditsPanel();
if (hiddenPanels.indexOf("console") === -1)
this.panels.console = new WebInspector.ConsolePanel();
if (hiddenPanels.indexOf("aardwolf") === -1) {
var webIns = this;
$.ajax({
async : false,
url : document.location.href.replace("/client/","/ws/reload/ip"),
success: function (data) {
webIns.panels.aardwolf = new WebInspector.ExtensionPanel("aardwolf", "Debug", "Images/reloadDebugIcon.png", { ip : data});
},
error: function (xhr, textStatus, error) {
}
});
}
},

get attached()
Expand Down

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions weinre.server/lib/weinre.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,40 @@ startServer = () ->

app.use jsonBodyParser()

#-------------------------------------------------------------------------------
# RPC Request to Reload for aquiring ip address
app.all /^\/ws\/reload(.*)/, (request, response, next) ->
http = require "http"
responseData = ""
options =
port: 8283
method : "POST"
headers :
"Content-Type" : "application/json"

data =
method : "manager.getNetworkIP"
params : []
id : null

req = http.request options, (res) ->
res.on "data", (chunk) ->
responseData += chunk
return
res.on "end", () ->
response.send (JSON.parse responseData).result
return
return

req.on "error", (e) ->
console.log("Cannot make request to reload server: " + e)
response.send 500
return

req.write JSON.stringify data
req.end()
return

app.all /^\/ws\/client(.*)/, (request, response, next) ->
uri = request.params[0]
uri = '/' if uri == ''
Expand Down