summaryrefslogtreecommitdiffstats
path: root/devtools
diff options
context:
space:
mode:
Diffstat (limited to 'devtools')
-rw-r--r--devtools/client/inspector/markup/test/browser.ini2
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_update-on-navigtion.js5
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_update-on-navigtion_1.html1
-rw-r--r--devtools/client/inspector/markup/test/doc_markup_update-on-navigtion_2.html1
-rw-r--r--devtools/client/locales/en-US/webConsole.dtd5
-rw-r--r--devtools/client/preferences/devtools.js2
-rw-r--r--devtools/client/responsive.html/browser/web-navigation.js8
-rw-r--r--devtools/client/shared/widgets/TableWidget.js9
-rwxr-xr-xdevtools/client/sourceeditor/tern/def.js5
-rw-r--r--devtools/client/storage/ui.js42
-rw-r--r--devtools/client/webconsole/webconsole.js45
-rw-r--r--devtools/client/webconsole/webconsole.xul4
-rw-r--r--devtools/moz.build12
-rw-r--r--devtools/server/actors/webconsole.js6
-rw-r--r--devtools/server/child.js2
-rw-r--r--devtools/server/main.js2
-rw-r--r--devtools/shared/css/generated/properties-db.js21
-rw-r--r--devtools/shared/discovery/discovery.js13
-rw-r--r--devtools/shared/heapsnapshot/moz.build19
19 files changed, 139 insertions, 65 deletions
diff --git a/devtools/client/inspector/markup/test/browser.ini b/devtools/client/inspector/markup/test/browser.ini
index 3116e4beb..9ff73a6c6 100644
--- a/devtools/client/inspector/markup/test/browser.ini
+++ b/devtools/client/inspector/markup/test/browser.ini
@@ -32,6 +32,8 @@ support-files =
doc_markup_void_elements.xhtml
doc_markup_whitespace.html
doc_markup_xul.xul
+ doc_markup_update-on-navigtion_1.html
+ doc_markup_update-on-navigtion_2.html
head.js
helper_attributes_test_runner.js
helper_events_test_runner.js
diff --git a/devtools/client/inspector/markup/test/browser_markup_update-on-navigtion.js b/devtools/client/inspector/markup/test/browser_markup_update-on-navigtion.js
index 241cea672..c298878c3 100644
--- a/devtools/client/inspector/markup/test/browser_markup_update-on-navigtion.js
+++ b/devtools/client/inspector/markup/test/browser_markup_update-on-navigtion.js
@@ -5,9 +5,8 @@
// Test that markup view handles page navigation correctly.
-const SCHEMA = "data:text/html;charset=UTF-8,";
-const URL_1 = SCHEMA + "<div id='one' style='color:red;'>ONE</div>";
-const URL_2 = SCHEMA + "<div id='two' style='color:green;'>TWO</div>";
+const URL_1 = URL_ROOT + "doc_markup_update-on-navigtion_1.html";
+const URL_2 = URL_ROOT + "doc_markup_update-on-navigtion_2.html";
add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(URL_1);
diff --git a/devtools/client/inspector/markup/test/doc_markup_update-on-navigtion_1.html b/devtools/client/inspector/markup/test/doc_markup_update-on-navigtion_1.html
new file mode 100644
index 000000000..d2fdb1629
--- /dev/null
+++ b/devtools/client/inspector/markup/test/doc_markup_update-on-navigtion_1.html
@@ -0,0 +1 @@
+<div id='one' style='color:red;'>ONE</div>
diff --git a/devtools/client/inspector/markup/test/doc_markup_update-on-navigtion_2.html b/devtools/client/inspector/markup/test/doc_markup_update-on-navigtion_2.html
new file mode 100644
index 000000000..93d84a088
--- /dev/null
+++ b/devtools/client/inspector/markup/test/doc_markup_update-on-navigtion_2.html
@@ -0,0 +1 @@
+<div id='two' style='color:green;'>TWO</div>
diff --git a/devtools/client/locales/en-US/webConsole.dtd b/devtools/client/locales/en-US/webConsole.dtd
index 17ae02699..7d2eb1faa 100644
--- a/devtools/client/locales/en-US/webConsole.dtd
+++ b/devtools/client/locales/en-US/webConsole.dtd
@@ -11,6 +11,11 @@
<!ENTITY window.title "Web Console">
<!ENTITY browserConsole.title "Browser Console">
+<!-- LOCALIZATION NOTE (saveBodies.label): You can see this string in
+ - the Web Console and Browser Console menu. -->
+<!ENTITY saveBodies.label "Log Request and Response Bodies">
+<!ENTITY saveBodies.accesskey "L">
+
<!-- LOCALIZATION NOTE (openURL.label): You can see this string in the Web
- Console context menu. -->
<!ENTITY openURL.label "Open URL in New Tab">
diff --git a/devtools/client/preferences/devtools.js b/devtools/client/preferences/devtools.js
index 9de9cd34a..2f6ca2104 100644
--- a/devtools/client/preferences/devtools.js
+++ b/devtools/client/preferences/devtools.js
@@ -248,6 +248,7 @@ pref("devtools.webconsole.filter.log", true);
pref("devtools.webconsole.filter.debug", true);
pref("devtools.webconsole.filter.net", false);
pref("devtools.webconsole.filter.netxhr", false);
+pref("devtools.webconsole.filter.saveBodies", true);
// Deprecated - old console frontend
pref("devtools.webconsole.filter.network", true);
pref("devtools.webconsole.filter.networkinfo", false);
@@ -273,6 +274,7 @@ pref("devtools.browserconsole.filter.network", true);
pref("devtools.browserconsole.filter.networkinfo", false);
pref("devtools.browserconsole.filter.netwarn", true);
pref("devtools.browserconsole.filter.netxhr", false);
+pref("devtools.browserconsole.filter.saveBodies", false);
pref("devtools.browserconsole.filter.csserror", true);
pref("devtools.browserconsole.filter.cssparser", false);
pref("devtools.browserconsole.filter.csslog", false);
diff --git a/devtools/client/responsive.html/browser/web-navigation.js b/devtools/client/responsive.html/browser/web-navigation.js
index 4519df0bd..eee24993a 100644
--- a/devtools/client/responsive.html/browser/web-navigation.js
+++ b/devtools/client/responsive.html/browser/web-navigation.js
@@ -8,6 +8,7 @@ const { Ci, Cu, Cr } = require("chrome");
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
const Services = require("Services");
const { NetUtil } = require("resource://gre/modules/NetUtil.jsm");
+const { Utils } = require("resource://gre/modules/sessionstore/Utils.jsm");
function readInputStreamToString(stream) {
return NetUtil.readInputStreamToString(stream, stream.available());
@@ -61,11 +62,11 @@ BrowserElementWebNavigation.prototype = {
// No equivalent in the current BrowserElement API
this.loadURIWithOptions(uri, flags, referrer,
Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
- postData, headers, null);
+ postData, headers, null, null);
},
loadURIWithOptions(uri, flags, referrer, referrerPolicy, postData, headers,
- baseURI) {
+ baseURI, triggeringPrincipal) {
// No equivalent in the current BrowserElement API
this._sendMessage("WebNavigation:LoadURI", {
uri,
@@ -75,6 +76,9 @@ BrowserElementWebNavigation.prototype = {
postData: postData ? readInputStreamToString(postData) : null,
headers: headers ? readInputStreamToString(headers) : null,
baseURI: baseURI ? baseURI.spec : null,
+ triggeringPrincipal: triggeringPrincipal
+ ? Utils.serializePrincipal(triggeringPrincipal)
+ : null,
});
},
diff --git a/devtools/client/shared/widgets/TableWidget.js b/devtools/client/shared/widgets/TableWidget.js
index a0f0dfc11..57d2914d5 100644
--- a/devtools/client/shared/widgets/TableWidget.js
+++ b/devtools/client/shared/widgets/TableWidget.js
@@ -463,7 +463,14 @@ TableWidget.prototype = {
return;
}
- let selectedCell = this.tbody.querySelector(".theme-selected");
+ // We need to get the first *visible* selected cell. Some columns are hidden
+ // e.g. because they contain a unique compound key for cookies that is never
+ // displayed in the UI. To do this we get all selected cells and filter out
+ // any that are hidden.
+ let selectedCells = [...this.tbody.querySelectorAll(".theme-selected")]
+ .filter(cell => cell.clientWidth > 0);
+ // Select the first visible selected cell.
+ let selectedCell = selectedCells[0];
if (!selectedCell) {
return;
}
diff --git a/devtools/client/sourceeditor/tern/def.js b/devtools/client/sourceeditor/tern/def.js
index 71f6e7991..f4a7ba9c8 100755
--- a/devtools/client/sourceeditor/tern/def.js
+++ b/devtools/client/sourceeditor/tern/def.js
@@ -77,7 +77,8 @@
}
},
word: function(re) {
- var word = "", ch, re = re || /[\w$]/;
+ var word = "", ch;
+ re = re || /[\w$]/;
while ((ch = this.spec.charAt(this.pos)) && re.test(ch)) { word += ch; ++this.pos; }
return word;
},
@@ -187,7 +188,7 @@
if (top && this.forceNew) return new infer.Obj(base);
return infer.getInstance(base);
} else if (this.eat(":")) {
- var name = this.word(/[\w$\.]/)
+ name = this.word(/[\w$\.]/)
return infer.getSymbol(name)
} else if (comp && this.eat("!")) {
var arg = this.word(/\d/);
diff --git a/devtools/client/storage/ui.js b/devtools/client/storage/ui.js
index 7745c8da9..5bd29d297 100644
--- a/devtools/client/storage/ui.js
+++ b/devtools/client/storage/ui.js
@@ -482,24 +482,27 @@ StorageUI.prototype = {
* @param {object} See onUpdate docs
*/
handleChangedItems: function (changed) {
- if (this.tree.selectedItem) {
- let [type, host, db, objectStore] = this.tree.selectedItem;
- if (!changed[type] || !changed[type][host] ||
- changed[type][host].length == 0) {
- return;
- }
- try {
- let toUpdate = [];
- for (let name of changed[type][host]) {
- let names = JSON.parse(name);
- if (names[0] == db && names[1] == objectStore && names[2]) {
- toUpdate.push(name);
- }
+ let selectedItem = this.tree.selectedItem;
+ if (!selectedItem) {
+ return;
+ }
+
+ let [type, host, db, objectStore] = selectedItem;
+ if (!changed[type] || !changed[type][host] ||
+ changed[type][host].length == 0) {
+ return;
+ }
+ try {
+ let toUpdate = [];
+ for (let name of changed[type][host]) {
+ let names = JSON.parse(name);
+ if (names[0] == db && names[1] == objectStore && names[2]) {
+ toUpdate.push(name);
}
- this.fetchStorageObjects(type, host, toUpdate, REASON.UPDATE);
- } catch (ex) {
- this.fetchStorageObjects(type, host, changed[type][host], REASON.UPDATE);
}
+ this.fetchStorageObjects(type, host, toUpdate, REASON.UPDATE);
+ } catch (ex) {
+ this.fetchStorageObjects(type, host, changed[type][host], REASON.UPDATE);
}
},
@@ -830,6 +833,7 @@ StorageUI.prototype = {
if (!item) {
return;
}
+
this.table.clear();
this.hideSidebar();
this.searchBox.value = "";
@@ -1136,11 +1140,13 @@ StorageUI.prototype = {
* Handles adding an item from the storage
*/
onAddItem: function () {
- if (!this.tree.selectedItem) {
+ let selectedItem = this.tree.selectedItem;
+ if (!selectedItem) {
return;
}
+
let front = this.getCurrentFront();
- let [, host] = this.tree.selectedItem;
+ let [, host] = selectedItem;
// Prepare to scroll into view.
this.table.scrollIntoViewOnUpdate = true;
diff --git a/devtools/client/webconsole/webconsole.js b/devtools/client/webconsole/webconsole.js
index bd7f90a0e..f2031f18a 100644
--- a/devtools/client/webconsole/webconsole.js
+++ b/devtools/client/webconsole/webconsole.js
@@ -555,6 +555,19 @@ WebConsoleFrame.prototype = {
// calculations.
this._updateCharSize();
+ let saveBodiesDisabled = !this.getFilterState("networkinfo") &&
+ !this.getFilterState("netxhr") &&
+ !this.getFilterState("network");
+
+ let saveBodies = this.document.getElementById("saveBodies");
+ saveBodies.disabled = saveBodiesDisabled;
+
+ saveBodies.parentNode.addEventListener("popupshowing", () => {
+ saveBodies.disabled = !this.getFilterState("networkinfo") &&
+ !this.getFilterState("netxhr") &&
+ !this.getFilterState("network");
+ });
+
this.jsterm = new JSTerm(this);
this.jsterm.init();
@@ -684,9 +697,9 @@ WebConsoleFrame.prototype = {
_initDefaultFilterPrefs: function () {
let prefs = ["network", "networkinfo", "csserror", "cssparser", "csslog",
"exception", "jswarn", "jslog", "error", "info", "warn", "log",
- "secerror", "secwarn", "netwarn", "netxhr", "sharedworkers",
- "serviceworkers", "windowlessworkers", "servererror",
- "serverwarn", "serverinfo", "serverlog"];
+ "secerror", "secwarn", "netwarn", "netxhr", "saveBodies",
+ "sharedworkers", "serviceworkers", "windowlessworkers",
+ "servererror", "serverwarn", "serverinfo", "serverlog"];
for (let pref of prefs) {
this.filterPrefs[pref] = Services.prefs.getBoolPref(
@@ -954,6 +967,16 @@ WebConsoleFrame.prototype = {
let prefKey = target.getAttribute("prefKey");
this.setFilterState(prefKey, state);
+ // Disable the log response and request body if network logging is off.
+ if (prefKey == "networkinfo" ||
+ prefKey == "netxhr" ||
+ prefKey == "network") {
+ let checkState = !this.getFilterState("networkinfo") &&
+ !this.getFilterState("netxhr") &&
+ !this.getFilterState("network");
+ this.document.getElementById("saveBodies").disabled = checkState;
+ }
+
// Adjust the state of the button appropriately.
let menuPopup = target.parentNode;
@@ -987,9 +1010,12 @@ WebConsoleFrame.prototype = {
_setMenuState: function (target, state) {
let menuItems = target.querySelectorAll("menuitem");
Array.forEach(menuItems, (item) => {
- item.setAttribute("checked", state);
let prefKey = item.getAttribute("prefKey");
- this.setFilterState(prefKey, state);
+ // If not a separate switch only.
+ if (prefKey != "saveBodies") {
+ item.setAttribute("checked", state);
+ this.setFilterState(prefKey, state);
+ }
});
},
@@ -1006,6 +1032,10 @@ WebConsoleFrame.prototype = {
Services.prefs.setBoolPref(this._filterPrefsPrefix + toggleType, state);
+ if (toggleType == "saveBodies") {
+ this.setSaveRequestAndResponseBodies(state);
+ }
+
if (this._updateListenersTimeout) {
clearTimeout(this._updateListenersTimeout);
}
@@ -3245,9 +3275,8 @@ WebConsoleConnectionProxy.prototype = {
this.webConsoleClient = webConsoleClient;
this._hasNativeConsoleAPI = response.nativeConsoleAPI;
- // There is no way to view response bodies from the Browser Console, so do
- // not waste the memory.
- let saveBodies = !this.webConsoleFrame.isBrowserConsole;
+ let saveBodiesPref = this.webConsoleFrame._filterPrefsPrefix + "saveBodies";
+ let saveBodies = Services.prefs.getBoolPref(saveBodiesPref);
this.webConsoleFrame.setSaveRequestAndResponseBodies(saveBodies);
this.webConsoleClient.on("networkEvent", this._onNetworkEvent);
diff --git a/devtools/client/webconsole/webconsole.xul b/devtools/client/webconsole/webconsole.xul
index 1310fb57d..36f9f03bf 100644
--- a/devtools/client/webconsole/webconsole.xul
+++ b/devtools/client/webconsole/webconsole.xul
@@ -96,6 +96,10 @@ function goUpdateConsoleCommands() {
prefKey="netxhr"/>
<menuitem label="&btnConsoleLog;" type="checkbox" autocheck="false"
prefKey="networkinfo"/>
+ <menuseparator id="saveBodiesSeparator" />
+ <menuitem id="saveBodies" type="checkbox" label="&saveBodies.label;"
+ accesskey="&saveBodies.accesskey;" autocheck="false"
+ prefKey="saveBodies"/>
</menupopup>
</toolbarbutton>
<toolbarbutton label="&btnPageCSS.label;" type="menu-button"
diff --git a/devtools/moz.build b/devtools/moz.build
index 8e368facb..dd9f90c5a 100644
--- a/devtools/moz.build
+++ b/devtools/moz.build
@@ -7,11 +7,13 @@
if CONFIG['MOZ_DEVTOOLS']:
DIRS += ['client']
-
-DIRS += [
- 'server',
- 'shared',
-]
+if CONFIG['MOZ_DEVTOOLS_SERVER']:
+ DIRS += [
+ 'server',
+ 'shared',
+ ]
+else:
+ DIRS += ['shared/heapsnapshot/']
# /browser uses DIST_SUBDIR. We opt-in to this treatment when building
# DevTools for the browser to keep the root omni.ja slim for use by external XUL
diff --git a/devtools/server/actors/webconsole.js b/devtools/server/actors/webconsole.js
index 9712ff32d..a1eba84ed 100644
--- a/devtools/server/actors/webconsole.js
+++ b/devtools/server/actors/webconsole.js
@@ -778,8 +778,8 @@ WebConsoleActor.prototype =
}
// See `window` definition. It isn't always a DOM Window.
- let requestStartTime = this.window && this.window.performance ?
- this.window.performance.timing.requestStart : 0;
+ let winStartTime = this.window && this.window.performance ?
+ this.window.performance.timing.navigationStart : 0;
let cache = this.consoleAPIListener
.getCachedMessages(!this.parentActor.isRootActor);
@@ -787,7 +787,7 @@ WebConsoleActor.prototype =
// Filter out messages that came from a ServiceWorker but happened
// before the page was requested.
if (aMessage.innerID === "ServiceWorker" &&
- requestStartTime > aMessage.timeStamp) {
+ winStartTime > aMessage.timeStamp) {
return;
}
diff --git a/devtools/server/child.js b/devtools/server/child.js
index e2838f08d..c69b0a3fb 100644
--- a/devtools/server/child.js
+++ b/devtools/server/child.js
@@ -61,7 +61,7 @@ try {
try {
m = require(module);
- if (!setupChild in m) {
+ if (!(setupChild in m)) {
dumpn(`ERROR: module '${module}' does not export '${setupChild}'`);
return false;
}
diff --git a/devtools/server/main.js b/devtools/server/main.js
index 475995493..ac76adb83 100644
--- a/devtools/server/main.js
+++ b/devtools/server/main.js
@@ -1040,7 +1040,7 @@ var DebuggerServer = {
try {
m = require(module);
- if (!setupParent in m) {
+ if (!(setupParent in m)) {
dumpn(`ERROR: module '${module}' does not export '${setupParent}'`);
return false;
}
diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js
index 83b3efafc..070167496 100644
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -3064,6 +3064,7 @@ exports.CSS_PROPERTIES = {
"text-emphasis-style",
"-webkit-text-fill-color",
"text-indent",
+ "text-justify",
"text-orientation",
"text-overflow",
"text-rendering",
@@ -3240,6 +3241,7 @@ exports.CSS_PROPERTIES = {
"dialog",
"difference",
"disabled",
+ "distribute",
"dotted",
"double",
"drag",
@@ -3299,6 +3301,8 @@ exports.CSS_PROPERTIES = {
"inline-table",
"inset",
"inside",
+ "inter-character",
+ "inter-word",
"intersect",
"isolate",
"italic",
@@ -8865,6 +8869,23 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
+ "text-justify": {
+ "isInherited": true,
+ "subproperties": [
+ "text-justify"
+ ],
+ "supports": [],
+ "values": [
+ "auto",
+ "distribute",
+ "inherit",
+ "initial",
+ "inter-character",
+ "inter-word",
+ "none",
+ "unset"
+ ]
+ },
"text-orientation": {
"isInherited": true,
"subproperties": [
diff --git a/devtools/shared/discovery/discovery.js b/devtools/shared/discovery/discovery.js
index d0b49f129..3aa82ef6e 100644
--- a/devtools/shared/discovery/discovery.js
+++ b/devtools/shared/discovery/discovery.js
@@ -181,18 +181,7 @@ LocalDevice.prototype = {
* Triggers the |name| setter to persist if needed.
*/
_generate: function () {
- if (Services.appinfo.widgetToolkit == "gonk") {
- // For Firefox OS devices, create one from the device name plus a little
- // randomness. The goal is just to distinguish devices in an office
- // environment where many people may have the same device model for
- // testing purposes (which would otherwise all report the same name).
- let name = libcutils.property_get("ro.product.device");
- // Pick a random number from [0, 2^32)
- let randomID = Math.floor(Math.random() * Math.pow(2, 32));
- // To hex and zero pad
- randomID = ("00000000" + randomID.toString(16)).slice(-8);
- this.name = name + "-" + randomID;
- } else if (Services.appinfo.widgetToolkit == "android") {
+ if (Services.appinfo.widgetToolkit == "android") {
// For Firefox for Android, use the device's model name.
// TODO: Bug 1180997: Find the right way to expose an editable name
this.name = sysInfo.get("device");
diff --git a/devtools/shared/heapsnapshot/moz.build b/devtools/shared/heapsnapshot/moz.build
index d020da727..fa9ef3915 100644
--- a/devtools/shared/heapsnapshot/moz.build
+++ b/devtools/shared/heapsnapshot/moz.build
@@ -48,15 +48,16 @@ DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
FINAL_LIBRARY = 'xul'
-DevToolsModules(
- 'census-tree-node.js',
- 'CensusUtils.js',
- 'DominatorTreeNode.js',
- 'HeapAnalysesClient.js',
- 'HeapAnalysesWorker.js',
- 'HeapSnapshotFileUtils.js',
- 'shortest-paths.js',
-)
+if CONFIG['MOZ_DEVTOOLS_SERVER']:
+ DevToolsModules(
+ 'census-tree-node.js',
+ 'CensusUtils.js',
+ 'DominatorTreeNode.js',
+ 'HeapAnalysesClient.js',
+ 'HeapAnalysesWorker.js',
+ 'HeapSnapshotFileUtils.js',
+ 'shortest-paths.js',
+ )
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']