Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: devtools-panel.js

Issue 29573905: Issue 4580 - Replace ext.devtools with devtools Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Created Oct. 11, 2017, 10:38 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « background.js ('k') | ext/background.js » ('j') | ext/common.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devtools-panel.js
===================================================================
--- a/devtools-panel.js
+++ b/devtools-panel.js
@@ -66,17 +66,17 @@
button.classList.add("action");
button.addEventListener("click", () =>
{
chrome.runtime.sendMessage({
type: "filters." + action,
text: filter
});
- }, false);
+ });
return button;
}
function createRecord(request, filter, template)
{
let row = document.importNode(template, true);
row.dataset.type = request.type;
@@ -91,18 +91,18 @@
{
urlElement.textContent = request.url;
if (request.type != "POPUP")
{
urlElement.classList.add("resourceLink");
urlElement.addEventListener("click", () =>
{
- ext.devtools.panels.openResource(request.url);
- }, false);
+ chrome.devtools.panels.openResource(request.url);
+ });
}
}
if (filter)
{
let filterElement = row.querySelector(".filter");
let originElement = row.querySelector(".origin");
@@ -188,28 +188,28 @@
document.addEventListener("DOMContentLoaded", () =>
{
let container = document.getElementById("items");
let table = container.querySelector("tbody");
let template = document.querySelector("template").content.firstElementChild;
document.getElementById("reload").addEventListener("click", () =>
{
- ext.devtools.inspectedWindow.reload();
- }, false);
+ chrome.devtools.inspectedWindow.reload();
+ });
document.getElementById("filter-state").addEventListener("change", (event) =>
{
container.dataset.filterState = event.target.value;
- }, false);
+ });
document.getElementById("filter-type").addEventListener("change", (event) =>
{
container.dataset.filterType = event.target.value;
- }, false);
Manish Jethani 2017/10/11 22:46:00 Bonus.
+ });
ext.onMessage.addListener((message) =>
{
switch (message.type)
{
case "add-record":
table.appendChild(createRecord(message.request, message.filter,
template));
@@ -251,9 +251,9 @@
}
});
// Since Chrome 54 the themeName is accessible, for earlier versions we must
// assume the default theme is being used.
// https://bugs.chromium.org/p/chromium/issues/detail?id=608869
let theme = chrome.devtools.panels.themeName || "default";
document.body.classList.add(theme);
-}, false);
+});
« no previous file with comments | « background.js ('k') | ext/background.js » ('j') | ext/common.js » ('J')

Powered by Google App Engine
This is Rietveld