Skip to content

Commit

Permalink
Merge branch 'remote_debug_bug_and_i18n_fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
667 committed Jan 22, 2017
2 parents ccf95fa + 43e5ec3 commit 2859cdc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Continuation Labs
Copyright (c) 2016-2017 June07

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 16 additions & 1 deletion background.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ ngApp
responseType: "json"
})
.then(function openDevToolsFrontend(json) {
var url = json.data[0].devtoolsFrontendUrl.replace("127.0.0.1:9229", host + ":" + port).replace("localhost:9229", host + ":" + port);
var url = json.data[0].devtoolsFrontendUrl
.replace("127.0.0.1:9229", host + ":" + port)
.replace("localhost:9229", host + ":" + port)
.replace("127.0.0.1:" + port, host + ":" + port) // In the event that remote debugging is being used and the infoUrl port (by default 80) is not forwarded.
.replace("localhost:" + port, host + ":" + port) // A check for just the port change must be made.
if ($scope.settings.localDevTools)
url = url.replace('https://chrome-devtools-frontend.appspot.com', 'chrome-devtools://devtools/remote');
var websocketId = json.data[0].id;
Expand Down Expand Up @@ -250,4 +254,15 @@ ngApp
if (devToolsSession.id === tabId) return true;
}), 1);
});
chrome.commands.onCommand.addListener(function(command) {
switch (command) {
case "open-devtools":
$scope.save("host");
$scope.save("port");
$scope.openTab($scope.settings.host, $scope.settings.port, function (result) {
$scope.message += '<br>' + result + '.';
});
$window._gaq.push(['_trackEvent', 'User Event', 'OpenDevTools', 'Keyboard Shortcut Used', '', true]); break;
}
});
}]);
13 changes: 11 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_appName__",
"short_name": "__MSG_appShortName__",
"version": "0.9.2",
"version": "0.9.3",
"default_locale": "en",
"description": "__MSG_appDescription__",
"author": "June07 <667@june07.com> (http://june07.com/)",
Expand Down Expand Up @@ -32,5 +32,14 @@
"background": {
"page": "background.html"
},
"content_security_policy": "script-src 'self' https://www.google-analytics.com https://ssl.google-analytics.com; object-src 'self' https://www.google-analytics.com https://ssl.google-analytics.com;"
"content_security_policy": "script-src 'self' https://www.google-analytics.com https://ssl.google-analytics.com; object-src 'self' https://www.google-analytics.com https://ssl.google-analytics.com;",
"commands": {
"open-devtools": {
"suggested_key": {
"default": "Ctrl+I",
"mac": "Command+I"
},
"description": "Open the DevTools Window"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "NIM",
"version": "0.9.2",
"version": "0.9.3",
"description": "Monitor the integrated Node V8 inspector and auto open Chrome DevTools",
"main": "nim.js",
"dependencies": {
Expand Down
10 changes: 9 additions & 1 deletion popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ ngApp
$scope.track = function (url) {
$window._gaq.push(['_trackPageview', url]);
};

function trackInputClick(e) {
$window._gaq.push(['_trackEvent', e.target.id, 'clicked']);
}
Expand All @@ -51,7 +50,16 @@ ngApp
function trackInputClickListener(event) {
trackInputClick(event);
}
function keypressHandler(event) {
if (event.keyCode === 13) {
event.preventDefault();
$scope.clickHandler();
$window._gaq.push(['_trackEvent', 'User Event', 'OpenDevTools', 'Enter Key Pressed', '', true]);
}
}
for (var i = 0; i < userInputs.length; i++) {
userInputs[i].addEventListener('click', trackInputClickListener);
if (userInputs[i].id === "port" || userInputs[i].id === "hostname")
userInputs[i].addEventListener('keypress', keypressHandler);
}
}]);

0 comments on commit 2859cdc

Please sign in to comment.