摘要:是可以在的源面板中創(chuàng)建和執(zhí)行的小腳本。通過(guò)在和屬性的末尾添加來(lái)覆蓋所有鏈接和可選腳本標(biāo)記。默認(rèn)情況下,不執(zhí)行處理腳本,應(yīng)將變量更改為以運(yùn)行這些腳本。在一個(gè)不錯(cuò)的表中顯示所有表單元素及其值和類(lèi)型。使用和分組來(lái)組織信息。
Snippets是可以在Chrome DevTools的“源”面板中創(chuàng)建和執(zhí)行的小腳本。 您可以從任何頁(yè)面訪問(wèn)和運(yùn)行它們。 當(dāng)您運(yùn)行代碼段時(shí),它會(huì)從當(dāng)前打開(kāi)的頁(yè)面的上下文執(zhí)行。顯示所有元素的邊框,看頁(yè)面布局非常方便
[].forEach.call($$("*"),function(a){ a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16) });allcolors.js
從頁(yè)面上的元素中使用的計(jì)算樣式打印所有顏色。 使用樣式化的console.log調(diào)用來(lái)可視化每種顏色。
// allcolors.js // https://github.com/bgrins/devtools-snippets // Print out CSS colors used in elements on the page. (function () { // Should include colors from elements that have a border color but have a zero width? var includeBorderColorsWithZeroWidth = false; var allColors = {}; var props = ["background-color", "color", "border-top-color", "border-right-color", "border-bottom-color", "border-left-color"]; var skipColors = { "rgb(0, 0, 0)": 1, "rgba(0, 0, 0, 0)": 1, "rgb(255, 255, 255)": 1 }; [].forEach.call(document.querySelectorAll("*"), function (node) { var nodeColors = {}; props.forEach(function (prop) { var color = window.getComputedStyle(node, null).getPropertyValue(prop), thisIsABorderProperty = (prop.indexOf("border") != -1), notBorderZero = thisIsABorderProperty ? window.getComputedStyle(node, null).getPropertyValue(prop.replace("color", "width")) !== "0px" : true, colorConditionsMet; if (includeBorderColorsWithZeroWidth) { colorConditionsMet = color && !skipColors[color]; } else { colorConditionsMet = color && !skipColors[color] && notBorderZero; } if (colorConditionsMet) { if (!allColors[color]) { allColors[color] = { count: 0, nodes: [] }; } if (!nodeColors[color]) { allColors[color].count++; allColors[color].nodes.push(node); } nodeColors[color] = true; } }); }); function rgbTextToRgbArray(rgbText) { return rgbText.replace(/s/g, "").match(/d+,d+,d+/)[0].split(",").map(function(num) { return parseInt(num, 10); }); } function componentToHex(c) { var hex = c.toString(16); return hex.length == 1 ? "0" + hex : hex; } function rgbToHex(rgbArray) { var r = rgbArray[0], g = rgbArray[1], b = rgbArray[2]; return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b); } var allColorsSorted = []; for (var i in allColors) { var rgbArray = rgbTextToRgbArray(i); var hexValue = rgbToHex(rgbArray); allColorsSorted.push({ key: i, value: allColors[i], hexValue: hexValue }); } allColorsSorted = allColorsSorted.sort(function (a, b) { return b.value.count - a.value.count; }); var nameStyle = "font-weight:normal;"; var countStyle = "font-weight:bold;"; function colorStyle(color) { return "background:" + color + ";color:" + color + ";border:1px solid #333;"; }; console.group("Total colors used in elements on the page: " + window.location.href + " are " + allColorsSorted.length); allColorsSorted.forEach(function (c) { console.groupCollapsed("%c %c " + c.key + " " + c.hexValue + " %c(" + c.value.count + " times)", colorStyle(c.key), nameStyle, countStyle); c.value.nodes.forEach(function (node) { console.log(node); }); console.groupEnd(); }); console.groupEnd("All colors used in elements on the page"); })();cachebuster.js
通過(guò)在href和src屬性的末尾添加Date.now()來(lái)覆蓋所有鏈接和(可選)腳本標(biāo)記。 默認(rèn)情況下,不執(zhí)行處理腳本,應(yīng)將變量process_scripts更改為true以運(yùn)行這些腳本。
//Cache Buster (function (){ var rep = /.*?.*/, links = document.getElementsByTagName("link"), scripts = document.getElementsByTagName("script"), process_scripts = false; for (var i=0;iconsole-save.js 從控制臺(tái)將對(duì)象保存為.json文件的簡(jiǎn)單方法包括一個(gè)chrome擴(kuò)展和一個(gè)純文本。console.save(data, [filename])(function(console){ console.save = function(data, filename){ if(!data) { console.error("Console.save: No data") return; } if(!filename) filename = "console.json" if(typeof data === "object"){ data = JSON.stringify(data, undefined, 4) } var blob = new Blob([data], {type: "text/json"}), e = document.createEvent("MouseEvents"), a = document.createElement("a") a.download = filename a.href = window.URL.createObjectURL(blob) a.dataset.downloadurl = ["text/json", a.download, a.href].join(":") e.initMouseEvent("click", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null) a.dispatchEvent(e) } })(console)formcontrols.js在一個(gè)不錯(cuò)的表中顯示所有html表單元素及其值和類(lèi)型。 在頁(yè)面上為每個(gè)表單添加一個(gè)新表// formcontrols.js // https://github.com/bgrins/devtools-snippets // Print out forms and their controls (function() { var forms = document.querySelectorAll("form"); for (var i = 0, len = forms.length; i < len; i++) { var tab = [ ]; console.group("HTMLForm quot;" + forms[i].name + "quot;: " + forms[i].action); console.log("Element:", forms[i], " Name: "+forms[i].name+" Method: "+forms[i].method.toUpperCase()+" Action: "+forms[i].action || "null"); ["input", "textarea", "select"].forEach(function (control) { [].forEach.call(forms[i].querySelectorAll(control), function (node) { tab.push({ "Element": node, "Type": node.type, "Name": node.name, "Value": node.value, "Pretty Value": (isNaN(node.value) || node.value === "" ? node.value : parseFloat(node.value)) }); }); }); console.table(tab); console.groupEnd(); } })();log-globals.js打印全局變量* log-globals by Sindre Sorhus https://github.com/sindresorhus/log-globals MIT License */ (function () { "use strict"; function getIframe() { var el = document.createElement("iframe"); el.style.display = "none"; document.body.appendChild(el); var win = el.contentWindow; document.body.removeChild(el); return win; } function detectGlobals() { var iframe = getIframe(); var ret = Object.create(null); for (var prop in window) { if (!(prop in iframe)) { ret[prop] = window[prop]; } } return ret; } console.log(detectGlobals()); })();performance.js打印有關(guān)window.performance對(duì)象的信息。 使用console.table和分組來(lái)組織信息。// performance.js // https://github.com/bgrins/devtools-snippets // Print out window.performance information. // https://developer.mozilla.org/en-US/docs/Navigation_timing (function () { var t = window.performance.timing; var lt = window.chrome && window.chrome.loadTimes && window.chrome.loadTimes(); var timings = []; timings.push({ label: "Time Until Page Loaded", time: t.loadEventEnd - t.navigationStart + "ms" }); timings.push({ label: "Time Until DOMContentLoaded", time: t.domContentLoadedEventEnd - t.navigationStart + "ms" }); timings.push({ label: "Total Response Time", time: t.responseEnd - t.requestStart + "ms" }); timings.push({ label: "Connection", time: t.connectEnd - t.connectStart + "ms" }); timings.push({ label: "Response", time: t.responseEnd - t.responseStart + "ms" }); timings.push({ label: "Domain Lookup", time: t.domainLookupEnd - t.domainLookupStart + "ms" }); timings.push({ label: "Load Event", time: t.loadEventEnd - t.loadEventStart + "ms" }); timings.push({ label: "Unload Event", time: t.unloadEventEnd - t.unloadEventStart + "ms" }); timings.push({ label: "DOMContentLoaded Event", time: t.domContentLoadedEventEnd - t.domContentLoadedEventStart + "ms" }); if(lt) { if(lt.wasNpnNegotiated) { timings.push({ label: "NPN negotiation protocol", time: lt.npnNegotiatedProtocol }); } timings.push({ label: "Connection Info", time: lt.connectionInfo }); timings.push({ label: "First paint after Document load", time: Math.ceil(lt.firstPaintTime - lt.finishDocumentLoadTime) + "ms" }); } var navigation = window.performance.navigation; var navigationTypes = { }; navigationTypes[navigation.TYPE_NAVIGATENEXT || 0] = "Navigation started by clicking on a link, or entering the URL in the user agent"s address bar, or form submission.", navigationTypes[navigation.TYPE_RELOAD] = "Navigation through the reload operation or the location.reload() method.", navigationTypes[navigation.TYPE_BACK_FORWARD] = "Navigation through a history traversal operation.", navigationTypes[navigation.TYPE_UNDEFINED] = "Navigation type is undefined.", console.group("window.performance"); console.log(window.performance); console.group("Navigation Information"); console.log(navigationTypes[navigation.type]); console.log("Number of redirects that have taken place: ", navigation.redirectCount) console.groupEnd("Navigation Information"); console.group("Timing"); console.log(window.performance.timing); console.table(timings, ["label", "time"]); console.groupEnd("Timing"); console.groupEnd("window.performance"); })();更多有意思的:http://bgrins.github.io/devto...
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/81576.html
摘要:是可以在的源面板中創(chuàng)建和執(zhí)行的小腳本。通過(guò)在和屬性的末尾添加來(lái)覆蓋所有鏈接和可選腳本標(biāo)記。默認(rèn)情況下,不執(zhí)行處理腳本,應(yīng)將變量更改為以運(yùn)行這些腳本。在一個(gè)不錯(cuò)的表中顯示所有表單元素及其值和類(lèi)型。使用和分組來(lái)組織信息。 Snippets是可以在Chrome DevTools的源面板中創(chuàng)建和執(zhí)行的小腳本。 您可以從任何頁(yè)面訪問(wèn)和運(yùn)行它們。 當(dāng)您運(yùn)行代碼段時(shí),它會(huì)從當(dāng)前打開(kāi)的頁(yè)面的上下文執(zhí)行...
摘要:是可以在的源面板中創(chuàng)建和執(zhí)行的小腳本。通過(guò)在和屬性的末尾添加來(lái)覆蓋所有鏈接和可選腳本標(biāo)記。默認(rèn)情況下,不執(zhí)行處理腳本,應(yīng)將變量更改為以運(yùn)行這些腳本。在一個(gè)不錯(cuò)的表中顯示所有表單元素及其值和類(lèi)型。使用和分組來(lái)組織信息。 Snippets是可以在Chrome DevTools的源面板中創(chuàng)建和執(zhí)行的小腳本。 您可以從任何頁(yè)面訪問(wèn)和運(yùn)行它們。 當(dāng)您運(yùn)行代碼段時(shí),它會(huì)從當(dāng)前打開(kāi)的頁(yè)面的上下文執(zhí)行...
摘要:雖然已經(jīng)成為了云領(lǐng)域的容器技術(shù)之王,但一個(gè)新的挑戰(zhàn)者已經(jīng)出現(xiàn)了。擁有一套集群來(lái)連接其他的集群服務(wù),例如以及亞馬遜的容器服務(wù)等。也對(duì)有著同樣的關(guān)注,后者是谷歌的開(kāi)源容器管理器。微軟公司于近期實(shí)施了,這是企業(yè)應(yīng)用容器技術(shù)的一個(gè)共同選擇。 雖然Docker已經(jīng)成為了云領(lǐng)域的容器技術(shù)之王,但一個(gè)新的挑戰(zhàn)者已經(jīng)出現(xiàn)了。專(zhuān)家David Linthicum針對(duì)這一競(jìng)爭(zhēng)進(jìn)行了分析。隨著新的一輪競(jìng)爭(zhēng)開(kāi)始,容器...
摘要:現(xiàn)為谷歌軟件工程師。盡管存在這兩個(gè)問(wèn)題,目前仍是最常用的,在搭建人工神經(jīng)網(wǎng)絡(luò)的時(shí)候推薦優(yōu)先嘗試函數(shù)人們?yōu)榱私鉀Q,提出了將的前半段設(shè)為而非。 夏飛,清華大學(xué)計(jì)算機(jī)軟件學(xué)士,卡內(nèi)基梅隆大學(xué)人工智能碩士。現(xiàn)為谷歌軟件工程師。TLDR (or the take-away)優(yōu)先使用ReLU (Rectified Linear Unit) 函數(shù)作為神經(jīng)元的activation function:背景深度...
摘要:外貿(mào)虛擬主機(jī)推薦進(jìn)入官網(wǎng)已經(jīng)將對(duì)的熱情轉(zhuǎn)化為您網(wǎng)站最快最簡(jiǎn)單的管理平臺(tái)。進(jìn)入官網(wǎng)已致力于及其社區(qū)超過(guò)年。阿里云虛擬主機(jī)根據(jù)不同配置情況不同成本價(jià)格,有北京杭州深圳香港美國(guó)等機(jī)房可以選擇。外貿(mào)用wordpress建站怎么樣?wordpress搭建外貿(mào)網(wǎng)站可以嗎?用wordpress搭建了個(gè)機(jī)加工外貿(mào)網(wǎng)站是可以的,如果你要的建設(shè)的是一個(gè)外貿(mào)網(wǎng)站,并想用這個(gè)網(wǎng)站去做谷歌推廣,那么,我建議大家一定選...
閱讀 2121·2023-04-26 02:19
閱讀 1914·2021-11-19 09:40
閱讀 1704·2021-09-29 09:35
閱讀 3575·2021-09-29 09:34
閱讀 4297·2021-09-07 10:16
閱讀 5530·2021-08-11 11:14
閱讀 3578·2019-08-30 15:54
閱讀 1629·2019-08-30 15:53