var tabURL; var cookieList = []; var backgroundPageConnection = chrome.runtime.connect({ name: "devtools-page" }); backgroundPageConnection.onMessage.addListener(function (message) { if (message.action === "getall") { createTable(message); } else if (message.action === "refresh") { location.reload(true); } }); jQuery(document).ready(function () { ++data.nPanelClicked; start(); }); function start() { var arguments = getUrlVars(); if (arguments.url !== undefined) {//TESTING PURPOSES createList("https://google.com"); return; } var tabId = chrome.devtools.inspectedWindow.tabId; backgroundPageConnection.postMessage({ action: "getall", tabId: tabId }); } function createList(url) { tabURL = url; chrome.cookies.getAll({ url: tabURL }, function (cks) { createTable({ url: tabURL, cks: cks }); }); } function createTable(message) { tabURL = message.url; cookieList = message.cks; $tableBody = $("#cookieTable > tbody"); $tableBody.empty(); for (var i = 0; i < cookieList.length; i++) { currentC = cookieList[i]; var domainDisabled = (currentC.hostOnly) ? "disabled" : ""; var expirationDisabled = (currentC.session) ? "disabled" : ""; $row = $(""); $row.append($("").addClass("hiddenColumn").text(i)); $row.append($("").addClass("editable").text(currentC.name)); $row.append($("").addClass("editable").text(currentC.value)); $row.append($("").addClass("editable domain " + domainDisabled).text(currentC.domain)); $row.append($("").addClass("editable").text(currentC.path)); if (currentC.session) { expDate = new Date(); expDate.setFullYear(expDate.getFullYear() + 1); } else { expDate = new Date(currentC.expirationDate * 1000.0); } $row.append($("").addClass("editable expiration " + expirationDisabled).text(expDate)); $row.append($("").append($("").attr("type", "checkbox").addClass("sessionCB").prop("checked", currentC.session))); $row.append($("").append($("").attr("type", "checkbox").addClass("hostOnlyCB").prop("checked", currentC.hostOnly))); $row.append($("").append($("").attr("type", "checkbox").prop("checked", currentC.secure))); $row.append($("").append($("").attr("type", "checkbox").prop("checked", currentC.httpOnly))); var $sameSite = $("