first commit

This commit is contained in:
klein panic
2024-09-29 01:05:25 -04:00
commit 2bcc806b8b
670 changed files with 96169 additions and 0 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
(()=>{function fetchResource(e){const reject=c=>{chrome.runtime.sendMessage({source:"react-devtools-fetch-resource-content-script",payload:{type:"fetch-file-with-cache-error",url:e,value:c}})};fetch(e,{cache:"force-cache"}).then((c=>{c.ok?c.text().then((c=>{return t=c,void chrome.runtime.sendMessage({source:"react-devtools-fetch-resource-content-script",payload:{type:"fetch-file-with-cache-complete",url:e,value:t}});var t})).catch((e=>reject(null))):reject(null)}),(e=>reject(null)))}chrome.runtime.onMessage.addListener((e=>{"devtools-page"===e?.source&&"fetch-file-with-cache"===e?.payload?.type&&fetchResource(e.payload.url)}))})();
//# sourceMappingURL=fileFetcher.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"fileFetcher.js","mappings":"MAEA,SAASA,cAAcC,GACrB,MAAMC,OAASC,IACbC,OAAOC,QAAQC,YAAY,CACzBC,OAAQ,+CACRC,QAAS,CACPC,KAAM,8BACNR,MACAE,UALJ,EAqBFO,MAAMT,EAAK,CAACU,MAAO,gBAAgBC,MACjCC,IACMA,EAASC,GACXD,EACGE,OACAH,MAAKG,IAAQC,OAhBNb,EAgBcY,OAf5BX,OAAOC,QAAQC,YAAY,CACzBC,OAAQ,+CACRC,QAAS,CACPC,KAAM,iCACNR,MACAE,WANUA,KAcV,IAGGc,OAAMC,GAAShB,OAAO,QAEzBA,OAAO,KACR,IAEHgB,GAAShB,OAAO,OAEnB,CAEDE,OAAOC,QAAQc,UAAUC,aAAYC,IAEb,kBAApBA,GAASd,QACkB,0BAA3Bc,GAASb,SAASC,MAElBT,cAAcqB,EAAQb,QAAQP,IAC/B,G","sources":["webpack:///./src/contentScripts/fileFetcher.js"],"names":["fetchResource","url","reject","value","chrome","runtime","sendMessage","source","payload","type","fetch","cache","then","response","ok","text","resolve","catch","error","onMessage","addListener","message"],"sourceRoot":"","ignoreList":[]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
(()=>{window.container=document.getElementById("container");let n=!1;window.injectStyles=e=>{if(!n){n=!0;const t=e();for(const n of t)document.head.appendChild(n)}}})();
//# sourceMappingURL=panel.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"panel.js","mappings":"MACAA,OAAOC,UAAYC,SAASC,eAAe,aAE3C,IAAIC,GAAoB,EAIxBJ,OAAOK,aAAeC,IACpB,IAAKF,EAAmB,CACtBA,GAAoB,EAEpB,MAAMG,EAAWD,IAGjB,IAAK,MAAME,KAAWD,EACpBL,SAASO,KAAKC,YAAYF,EAE7B,E","sources":["webpack:///./src/panel.js"],"names":["window","container","document","getElementById","hasInjectedStyles","injectStyles","getLinkTags","linkTags","linkTag","head","appendChild"],"sourceRoot":"","ignoreList":[]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
(()=>{"use strict";var e={4069:e=>{function nullthrows(e,r){if(null!=e)return e;var o=new Error(void 0!==r?r:"Got unexpected "+e);throw o.framesToPop=1,o}e.exports=nullthrows,e.exports.default=nullthrows,Object.defineProperty(e.exports,"__esModule",{value:!0})}},r={};function __webpack_require__(o){var _=r[o];if(void 0!==_)return _.exports;var t=r[o]={exports:{}};return e[o](t,t.exports,__webpack_require__),t.exports}__webpack_require__.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(r,{a:r}),r},__webpack_require__.d=(e,r)=>{for(var o in r)__webpack_require__.o(r,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{__webpack_require__(4069);let e;window.addEventListener("message",(function({data:r,source:o}){if(o===window&&r&&"react-devtools-hook"===r.source){const{source:o,payload:_}=r,t={source:o,payload:_};e=t,chrome.runtime.sendMessage(t)}})),window.addEventListener("pageshow",(function({target:r}){e&&r===window.document&&chrome.runtime.sendMessage(e)}))})()})();
//# sourceMappingURL=prepareInjection.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"prepareInjection.js","mappings":"mCAEA,SAASA,WAAWC,EAAGC,GACrB,GAAS,MAALD,EACF,OAAOA,EAET,IAAIE,EAAQ,IAAIC,WAAkBC,IAAZH,EAAwBA,EAAU,kBAAoBD,GAE5E,MADAE,EAAMG,YAAc,EACdH,CACP,CAEDI,EAAOC,QAAUR,WACjBO,EAAOC,QAAPD,QAAyBP,WAEzBS,OAAOC,eAAeH,EAAOC,QAAS,aAAtCC,CAAqDE,OAAO,G,GCbxDC,EAA2B,CAAC,EAGhC,SAASC,oBAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBT,IAAjBU,EACH,OAAOA,EAAaP,QAGrB,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,CAAC,GAOX,OAHAQ,EAAoBF,GAAUP,EAAQA,EAAOC,QAASK,qBAG/CN,EAAOC,OACf,CCrBAK,oBAAoBI,EAAKV,IACxB,IAAIW,EAASX,GAAUA,EAAOY,WAC7B,IAAOZ,EAAiB,QACxB,IAAM,EAEP,OADAM,oBAAoBO,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdL,oBAAoBO,EAAI,CAACZ,EAASc,KACjC,IAAI,IAAIC,KAAOD,EACXT,oBAAoBW,EAAEF,EAAYC,KAASV,oBAAoBW,EAAEhB,EAASe,IAC5Ed,OAAOC,eAAeF,EAASe,EAAK,CAAEE,YAAY,EAAMC,IAAKJ,EAAWC,IAE1E,ECNDV,oBAAoBW,EAAI,CAACG,EAAKC,IAAUnB,OAAOoB,UAAUC,eAAeC,KAAKJ,EAAKC,G,gCC4BlF,IAAII,EAQJC,OAAOC,iBAAiB,WAAW,UAAmB,KAACC,EAAD,OAAOC,IAC3D,GAAIA,IAAWH,QAAWE,GAKN,wBAAhBA,EAAKC,OAAkC,CACzC,MAAOA,OAAQC,EAAT,QAAwBC,GAAWH,EACnCjC,EAAU,CAACkC,OAAQC,EAAeC,WAExCN,EAA8B9B,EAC9BqC,OAAOC,QAAQC,YAAYvC,EAC5B,CACF,IAMD+B,OAAOC,iBAAiB,YAAY,UAAU,OAACQ,IACxCV,GAA+BU,IAAWT,OAAOU,UAItDJ,OAAOC,QAAQC,YAAYT,EAC5B,G","sources":["webpack:///../../node_modules/nullthrows/nullthrows.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./src/contentScripts/prepareInjection.js"],"names":["nullthrows","x","message","error","Error","undefined","framesToPop","module","exports","Object","defineProperty","value","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","enumerable","get","obj","prop","prototype","hasOwnProperty","call","lastSentDevToolsHookMessage","window","addEventListener","data","source","messageSource","payload","chrome","runtime","sendMessage","target","document"],"sourceRoot":"","ignoreList":[]}

View File

@@ -0,0 +1,2 @@
(()=>{"use strict";window.addEventListener("pageshow",(function({target:e}){if(!window.__REACT_DEVTOOLS_PROXY_INJECTED__){window.__REACT_DEVTOOLS_PROXY_INJECTED__=!0,connectPort(),sayHelloToBackendManager();const e=setInterval((()=>{n?clearInterval(e):sayHelloToBackendManager()}),500)}})),window.addEventListener("pagehide",(function({target:e}){e===window.document&&delete window.__REACT_DEVTOOLS_PROXY_INJECTED__}));let e=null,n=!1;function sayHelloToBackendManager(){window.postMessage({source:"react-devtools-content-script",hello:!0},"*")}function handleMessageFromDevtools(e){window.postMessage({source:"react-devtools-content-script",payload:e},"*")}function handleMessageFromPage(o){if(o.source===window&&o.data)switch(o.data.source){case"react-devtools-bridge":n=!0,e.postMessage(o.data.payload);break;case"react-devtools-backend-manager":{const{source:e,payload:n}=o.data;chrome.runtime.sendMessage({source:e,payload:n});break}}}function handleDisconnect(){window.removeEventListener("message",handleMessageFromPage),e=null,connectPort()}function connectPort(){e=chrome.runtime.connect({name:"proxy"}),window.addEventListener("message",handleMessageFromPage),e.onMessage.addListener(handleMessageFromDevtools),e.onDisconnect.addListener(handleDisconnect)}})();
//# sourceMappingURL=proxy.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"proxy.js","mappings":"mBAIAA,OAAOC,iBAAiB,YAAY,UAAU,OAACC,IAG7C,IAAKF,OAAOG,kCAAmC,CAC7CH,OAAOG,mCAAoC,EAE3CC,cACAC,2BAKA,MAAMC,EAAaC,aAAY,KACzBC,EACFC,cAAcH,GAEdD,0BACD,GACA,IACJ,CACF,IAEDL,OAAOC,iBAAiB,YAAY,UAAU,OAACC,IACzCA,IAAWF,OAAOU,iBAIfV,OAAOG,iCACf,IAED,IAAIQ,EAAO,KACPH,GAA8B,EAElC,SAASH,2BACPL,OAAOY,YACL,CACEC,OAAQ,gCACRC,OAAO,GAET,IAEH,CAED,SAASC,0BAA0BC,GACjChB,OAAOY,YACL,CACEC,OAAQ,gCACRI,QAASD,GAEX,IAEH,CAED,SAASE,sBAAsBC,GAC7B,GAAIA,EAAMN,SAAWb,QAAWmB,EAAMC,KAItC,OAAQD,EAAMC,KAAKP,QAEjB,IAAK,wBACHL,GAAqB,EAErBG,EAAKC,YAAYO,EAAMC,KAAKH,SAC5B,MAKF,IAAK,iCAAkC,CACrC,MAAM,OAACJ,EAAD,QAASI,GAAWE,EAAMC,KAEhCC,OAAOC,QAAQC,YAAY,CACzBV,SACAI,YAEF,KACD,EAEJ,CAED,SAASO,mBACPxB,OAAOyB,oBAAoB,UAAWP,uBACtCP,EAAO,KAEPP,aACD,CAID,SAASA,cACPO,EAAOU,OAAOC,QAAQI,QAAQ,CAC5BC,KAAM,UAGR3B,OAAOC,iBAAiB,UAAWiB,uBAEnCP,EAAKiB,UAAUC,YAAYd,2BAC3BJ,EAAKmB,aAAaD,YAAYL,iBAC/B,C","sources":["webpack:///./src/contentScripts/proxy.js"],"names":["window","addEventListener","target","__REACT_DEVTOOLS_PROXY_INJECTED__","connectPort","sayHelloToBackendManager","intervalID","setInterval","backendInitialized","clearInterval","document","port","postMessage","source","hello","handleMessageFromDevtools","message","payload","handleMessageFromPage","event","data","chrome","runtime","sendMessage","handleDisconnect","removeEventListener","connect","name","onMessage","addListener","onDisconnect"],"sourceRoot":"","ignoreList":[]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

View File

@@ -0,0 +1 @@
<svg id="Development" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><defs><style>.cls-1{fill:#d94a38;}.cls-2{fill:#fff;}.cls-3{fill:#231f20;}.cls-4{font-size:12px;font-family:MyriadPro-Regular, Myriad Pro;}</style></defs><title>development</title><g id="Background"><rect class="cls-1" width="1024" height="1024" rx="96" ry="96"/></g><g id="Rings"><g id="Ring-2" data-name="Ring"><path class="cls-2" d="M959,509c0-62-74-117-189-150,27-115,17-207-37-238s-139,6-224,88c-86-81-171-118-224-87s-64,123-36,239C135,394,61,449,61,511s74,117,189,150c-27,115-17,207,37,238s139-6,224-88c86,81,171,118,224,87s64-123,36-239C885,626,959,571,959,509ZM713,157c40,23,45,97,21,193a900,900,0,0,0-121-19,900,900,0,0,0-78-94C606,166,673,133,713,157ZM635,583c-14,24-28,47-43,69-27,2-54,3-83,3l-81-3c-15-22-30-46-44-70s-27-48-38-72c12-24,24-49,39-73s28-47,43-69c27-2,54-3,83-3l81,3c15,22,30,46,44,70s27,48,38,72C662,534,649,558,635,583Zm60-27c11,26,21,52,29,77-25,6-52,10-81,14l26-44ZM511,757c-17-19-35-40-52-63H563C546,716,528,738,511,757ZM378,647c-29-3-56-8-81-13,8-25,17-50,28-77l25,45ZM325,464c-11-26-21-52-29-77,25-6,52-10,81-14l-26,44ZM509,263c17,19,35,40,52,63H457C474,304,492,282,509,263ZM670,418l-28-45c29,3,56,8,81,13-8,25-17,50-28,77ZM305,158c40-23,106,9,177,78a900,900,0,0,0-77,95,900,900,0,0,0-120,20C260,255,265,181,305,158ZM102,511c0-46,61-88,156-114a900,900,0,0,0,44,114,900,900,0,0,0-43,114C164,599,102,558,102,511ZM307,863c-40-23-45-97-21-193a900,900,0,0,0,121,19,900,900,0,0,0,78,94C414,854,347,887,307,863Zm408-1c-40,23-106-9-177-78a900,900,0,0,0,77-95,900,900,0,0,0,120-20C760,765,755,839,715,862Zm46-239a900,900,0,0,0-44-114,900,900,0,0,0,43-114c96,26,157,67,157,114S856,597,761,623Z"/></g></g><g id="Ring_Blockers" data-name="Ring Blockers"><circle class="cls-1" cx="417" cy="672" r="45"/><circle class="cls-1" cx="699" cy="513" r="45"/><circle class="cls-1" cx="797" cy="634" r="45"/><circle class="cls-1" cx="479" cy="818" r="45"/><g id="Layer_14" data-name="Layer 14"><rect class="cls-1" x="420" y="621" width="377" height="188"/><rect class="cls-1" x="500" y="530" width="312" height="405"/></g></g><g id="Bug"><g id="Legs"><path class="cls-3" d="M702,496a17,17,0,0,0-21,13l-19,78,34,8,19-78A17,17,0,0,0,702,496Z"/><text class="cls-4" transform="translate(512 512)">780</text><text class="cls-4" transform="translate(512 512)">780</text><path class="cls-3" d="M813,626a17,17,0,0,0-23-9l-73,32,14,32,73-32A17,17,0,0,0,813,626Z"/><path class="cls-3" d="M834,756l-77-20-9,34,77,20a18,18,0,0,0,9-34Z"/><path class="cls-3" d="M425,656a17,17,0,1,0-10,33l76,23,10-33Z"/><path class="cls-3" d="M532,756l-64,48a18,18,0,1,0,21,28l64-48Z"/><path class="cls-3" d="M584,836l-21,77a17,17,0,1,0,34,9l21-77Z"/></g><g id="Body"><path class="cls-3" d="M762,690h0l-51-92h0A125,125,0,0,0,492,721h0l51,92h0A125,125,0,0,0,762,690Z"/></g><g id="Line"><path class="cls-1" d="M613,649h0a17,17,0,0,0-30,18h0L711,887l30-18Z"/></g><g id="Head_Ring" data-name="Head Ring"><circle class="cls-1" cx="511" cy="509" r="113"/></g><g id="Head"><circle class="cls-3" cx="512" cy="512" r="80"/></g></g></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1 @@
<svg id="Development" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><defs><style>.cls-1{fill:#d94a38;}.cls-2{fill:#fff;}.cls-3{fill:#231f20;}.cls-4{font-size:12px;font-family:MyriadPro-Regular, Myriad Pro;}</style></defs><title>development</title><g id="Background"><rect class="cls-1" width="1024" height="1024" rx="96" ry="96"/></g><g id="Rings"><g id="Ring-2" data-name="Ring"><path class="cls-2" d="M959,509c0-62-74-117-189-150,27-115,17-207-37-238s-139,6-224,88c-86-81-171-118-224-87s-64,123-36,239C135,394,61,449,61,511s74,117,189,150c-27,115-17,207,37,238s139-6,224-88c86,81,171,118,224,87s64-123,36-239C885,626,959,571,959,509ZM713,157c40,23,45,97,21,193a900,900,0,0,0-121-19,900,900,0,0,0-78-94C606,166,673,133,713,157ZM635,583c-14,24-28,47-43,69-27,2-54,3-83,3l-81-3c-15-22-30-46-44-70s-27-48-38-72c12-24,24-49,39-73s28-47,43-69c27-2,54-3,83-3l81,3c15,22,30,46,44,70s27,48,38,72C662,534,649,558,635,583Zm60-27c11,26,21,52,29,77-25,6-52,10-81,14l26-44ZM511,757c-17-19-35-40-52-63H563C546,716,528,738,511,757ZM378,647c-29-3-56-8-81-13,8-25,17-50,28-77l25,45ZM325,464c-11-26-21-52-29-77,25-6,52-10,81-14l-26,44ZM509,263c17,19,35,40,52,63H457C474,304,492,282,509,263ZM670,418l-28-45c29,3,56,8,81,13-8,25-17,50-28,77ZM305,158c40-23,106,9,177,78a900,900,0,0,0-77,95,900,900,0,0,0-120,20C260,255,265,181,305,158ZM102,511c0-46,61-88,156-114a900,900,0,0,0,44,114,900,900,0,0,0-43,114C164,599,102,558,102,511ZM307,863c-40-23-45-97-21-193a900,900,0,0,0,121,19,900,900,0,0,0,78,94C414,854,347,887,307,863Zm408-1c-40,23-106-9-177-78a900,900,0,0,0,77-95,900,900,0,0,0,120-20C760,765,755,839,715,862Zm46-239a900,900,0,0,0-44-114,900,900,0,0,0,43-114c96,26,157,67,157,114S856,597,761,623Z"/></g></g><g id="Ring_Blockers" data-name="Ring Blockers"><circle class="cls-1" cx="417" cy="672" r="45"/><circle class="cls-1" cx="699" cy="513" r="45"/><circle class="cls-1" cx="797" cy="634" r="45"/><circle class="cls-1" cx="479" cy="818" r="45"/><g id="Layer_14" data-name="Layer 14"><rect class="cls-1" x="420" y="621" width="377" height="188"/><rect class="cls-1" x="500" y="530" width="312" height="405"/></g></g><g id="Bug"><g id="Legs"><path class="cls-3" d="M702,496a17,17,0,0,0-21,13l-19,78,34,8,19-78A17,17,0,0,0,702,496Z"/><text class="cls-4" transform="translate(512 512)">780</text><text class="cls-4" transform="translate(512 512)">780</text><path class="cls-3" d="M813,626a17,17,0,0,0-23-9l-73,32,14,32,73-32A17,17,0,0,0,813,626Z"/><path class="cls-3" d="M834,756l-77-20-9,34,77,20a18,18,0,0,0,9-34Z"/><path class="cls-3" d="M425,656a17,17,0,1,0-10,33l76,23,10-33Z"/><path class="cls-3" d="M532,756l-64,48a18,18,0,1,0,21,28l64-48Z"/><path class="cls-3" d="M584,836l-21,77a17,17,0,1,0,34,9l21-77Z"/></g><g id="Body"><path class="cls-3" d="M762,690h0l-51-92h0A125,125,0,0,0,492,721h0l51,92h0A125,125,0,0,0,762,690Z"/></g><g id="Line"><path class="cls-1" d="M613,649h0a17,17,0,0,0-30,18h0L711,887l30-18Z"/></g><g id="Head_Ring" data-name="Head Ring"><circle class="cls-1" cx="511" cy="509" r="113"/></g><g id="Head"><circle class="cls-3" cx="512" cy="512" r="80"/></g></g></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1 @@
<svg id="Disabled" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><defs><style>.cls-1{fill:#aaa;}.cls-2{fill:#fff;}</style></defs><title>disabled</title><g id="Background"><rect class="cls-1" width="1024" height="1024" rx="96" ry="96"/></g><g id="Rings"><path class="cls-2" d="M959,509c0-62-74-117-189-150,27-115,17-207-37-238s-139,6-224,88c-86-81-171-118-224-87s-64,123-36,239C135,394,61,449,61,511s74,117,189,150c-27,115-17,207,37,238s139-6,224-88c86,81,171,118,224,87s64-123,36-239C885,626,959,571,959,509ZM713,157c40,23,45,97,21,193a900,900,0,0,0-121-19,900,900,0,0,0-78-94C606,166,673,133,713,157ZM635,583c-14,24-28,47-43,69-27,2-54,3-83,3l-81-3c-15-22-30-46-44-70s-27-48-38-72c12-24,24-49,39-73s28-47,43-69c27-2,54-3,83-3l81,3c15,22,30,46,44,70s27,48,38,72C662,534,649,558,635,583Zm60-27c11,26,21,52,29,77-25,6-52,10-81,14l26-44ZM511,757c-17-19-35-40-52-63H563C546,716,528,738,511,757ZM378,647c-29-3-56-8-81-13,8-25,17-50,28-77l25,45ZM325,464c-11-26-21-52-29-77,25-6,52-10,81-14l-26,44ZM509,263c17,19,35,40,52,63H457C474,304,492,282,509,263ZM670,418l-28-45c29,3,56,8,81,13-8,25-17,50-28,77ZM305,158c40-23,106,9,177,78a900,900,0,0,0-77,95,900,900,0,0,0-120,20C260,255,265,181,305,158ZM102,511c0-46,61-88,156-114a900,900,0,0,0,44,114,900,900,0,0,0-43,114C164,599,102,558,102,511ZM307,863c-40-23-45-97-21-193a900,900,0,0,0,121,19,900,900,0,0,0,78,94C414,854,347,887,307,863Zm408-1c-40,23-106-9-177-78a900,900,0,0,0,77-95,900,900,0,0,0,120-20C760,765,755,839,715,862Zm46-239a900,900,0,0,0-44-114,900,900,0,0,0,43-114c96,26,157,67,157,114S856,597,761,623Z"/></g><g id="Circle"><circle class="cls-2" cx="510" cy="510" r="80"/></g></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1 @@
<svg id="Outdated" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><defs><style>.cls-1{fill:#202020;}.cls-2{fill:#fff;}.cls-3{fill:#f9f453;}</style></defs><title>outdated</title><g id="Background"><rect class="cls-1" width="1024" height="1024" rx="96" ry="96"/></g><g id="Rings"><path class="cls-2" d="M510,325C261,325,60,408,60,510S261,695,510,695s450-83,450-185S759,325,510,325Zm0,330c-225,0-407-65-407-145S285,365,510,365s408,65,408,145S735,655,510,655Z"/><path class="cls-2" d="M670,417C546,202,373,69,285,120s-59,267,65,482S647,951,735,900,794,633,670,417ZM384,583C272,388,237,197,306,157s217,86,329,280,148,385,78,425S497,777,384,583Z"/><g id="BLOCKER"><rect class="cls-1" x="564" y="572" width="315" height="397.12" transform="translate(652 -283) rotate(39)"/><rect class="cls-1" x="685" y="369" width="283" height="360.81" transform="translate(255 -262) rotate(21)"/></g><path class="cls-2" d="M670,603c124-215,153-431,65-482S474,202,350,417,197,849,285,900,546,818,670,603ZM384,437C497,243,644,117,714,157s34,231-78,425S376,903,306,863,272,632,384,437Z"/></g><g id="Circle"><circle class="cls-2" cx="512" cy="512" r="80"/></g><g id="Shield"><path class="cls-3" d="M960,887a24,24,0,0,0-5-15h0L807,605h0v-2h0a25,25,0,0,0-43,3h0L613,876h0a24,24,0,0,0-3,11,25,25,0,0,0,24,25H936A25,25,0,0,0,960,887ZM810,848a15,15,0,0,1-15,15H775a15,15,0,0,1-15-15V828a15,15,0,0,1,15-15h20a15,15,0,0,1,15,15Zm0-74a15,15,0,0,1-15,15H775a15,15,0,0,1-15-15V705a15,15,0,0,1,15-15h20a15,15,0,0,1,15,15Z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1 @@
<svg id="Production" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><defs><style>.cls-1{fill:#202020;}.cls-2{fill:#59c9f1;}</style></defs><title>production</title><g id="Background"><rect class="cls-1" width="1024" height="1024" rx="96" ry="96"/></g><g id="Rings"><path class="cls-2" d="M959,509c0-62-74-117-189-150,27-115,17-207-37-238s-139,6-224,88c-86-81-171-118-224-87s-64,123-36,239C135,394,61,449,61,511s74,117,189,150c-27,115-17,207,37,238s139-6,224-88c86,81,171,118,224,87s64-123,36-239C885,626,959,571,959,509ZM713,157c40,23,45,97,21,193a900,900,0,0,0-121-19,900,900,0,0,0-78-94C606,166,673,133,713,157ZM635,583c-14,24-28,47-43,69-27,2-54,3-83,3l-81-3c-15-22-30-46-44-70s-27-48-38-72c12-24,24-49,39-73s28-47,43-69c27-2,54-3,83-3l81,3c15,22,30,46,44,70s27,48,38,72C662,534,649,558,635,583Zm60-27c11,26,21,52,29,77-25,6-52,10-81,14l26-44ZM511,757c-17-19-35-40-52-63H563C546,716,528,738,511,757ZM378,647c-29-3-56-8-81-13,8-25,17-50,28-77l25,45ZM325,464c-11-26-21-52-29-77,25-6,52-10,81-14l-26,44ZM509,263c17,19,35,40,52,63H457C474,304,492,282,509,263ZM670,418l-28-45c29,3,56,8,81,13-8,25-17,50-28,77ZM305,158c40-23,106,9,177,78a900,900,0,0,0-77,95,900,900,0,0,0-120,20C260,255,265,181,305,158ZM102,511c0-46,61-88,156-114a900,900,0,0,0,44,114,900,900,0,0,0-43,114C164,599,102,558,102,511ZM307,863c-40-23-45-97-21-193a900,900,0,0,0,121,19,900,900,0,0,0,78,94C414,854,347,887,307,863Zm408-1c-40,23-106-9-177-78a900,900,0,0,0,77-95,900,900,0,0,0,120-20C760,765,755,839,715,862Zm46-239a900,900,0,0,0-44-114,900,900,0,0,0,43-114c96,26,157,67,157,114S856,597,761,623Z"/></g><g id="Circle"><circle class="cls-2" cx="510" cy="510" r="80"/></g></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1 @@
<svg id="Disabled" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><defs><style>.cls-1{fill:#aaa;}.cls-2{fill:#fff;}</style></defs><title>disabled</title><g id="Background"><rect class="cls-1" width="1024" height="1024" rx="96" ry="96"/></g><g id="Rings"><path class="cls-2" d="M959,509c0-62-74-117-189-150,27-115,17-207-37-238s-139,6-224,88c-86-81-171-118-224-87s-64,123-36,239C135,394,61,449,61,511s74,117,189,150c-27,115-17,207,37,238s139-6,224-88c86,81,171,118,224,87s64-123,36-239C885,626,959,571,959,509ZM713,157c40,23,45,97,21,193a900,900,0,0,0-121-19,900,900,0,0,0-78-94C606,166,673,133,713,157ZM635,583c-14,24-28,47-43,69-27,2-54,3-83,3l-81-3c-15-22-30-46-44-70s-27-48-38-72c12-24,24-49,39-73s28-47,43-69c27-2,54-3,83-3l81,3c15,22,30,46,44,70s27,48,38,72C662,534,649,558,635,583Zm60-27c11,26,21,52,29,77-25,6-52,10-81,14l26-44ZM511,757c-17-19-35-40-52-63H563C546,716,528,738,511,757ZM378,647c-29-3-56-8-81-13,8-25,17-50,28-77l25,45ZM325,464c-11-26-21-52-29-77,25-6,52-10,81-14l-26,44ZM509,263c17,19,35,40,52,63H457C474,304,492,282,509,263ZM670,418l-28-45c29,3,56,8,81,13-8,25-17,50-28,77ZM305,158c40-23,106,9,177,78a900,900,0,0,0-77,95,900,900,0,0,0-120,20C260,255,265,181,305,158ZM102,511c0-46,61-88,156-114a900,900,0,0,0,44,114,900,900,0,0,0-43,114C164,599,102,558,102,511ZM307,863c-40-23-45-97-21-193a900,900,0,0,0,121,19,900,900,0,0,0,78,94C414,854,347,887,307,863Zm408-1c-40,23-106-9-177-78a900,900,0,0,0,77-95,900,900,0,0,0,120-20C760,765,755,839,715,862Zm46-239a900,900,0,0,0-44-114,900,900,0,0,0,43-114c96,26,157,67,157,114S856,597,761,623Z"/></g><g id="Circle"><circle class="cls-2" cx="510" cy="510" r="80"/></g></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,9 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="./build/main.js"></script>
</head>
<body>
</body>
</html>

View File

@@ -0,0 +1,63 @@
{
"update_url": "https://clients2.google.com/service/update2/crx",
"manifest_version": 3,
"name": "React Developer Tools",
"description": "Adds React debugging tools to the Chrome Developer Tools.\n\nCreated from revision 1717ab0171 on 5/8/2024.",
"version": "5.2.0",
"version_name": "5.2.0 (5/8/2024)",
"minimum_chrome_version": "102",
"icons": {
"16": "icons/16-production.png",
"32": "icons/32-production.png",
"48": "icons/48-production.png",
"128": "icons/128-production.png"
},
"action": {
"default_icon": {
"16": "icons/16-disabled.png",
"32": "icons/32-disabled.png",
"48": "icons/48-disabled.png",
"128": "icons/128-disabled.png"
},
"default_popup": "popups/disabled.html"
},
"devtools_page": "main.html",
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
},
"web_accessible_resources": [
{
"resources": [
"main.html",
"panel.html",
"build/*.js"
],
"matches": [
"<all_urls>"
],
"extension_ids": []
}
],
"background": {
"service_worker": "build/background.js"
},
"permissions": [
"storage",
"scripting"
],
"host_permissions": [
"<all_urls>"
],
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"build/prepareInjection.js"
],
"run_at": "document_start"
}
]
}

View File

@@ -0,0 +1,65 @@
<!doctype html>
<html style="display: flex">
<head>
<meta charset="utf8">
<style>
html {
display: flex;
}
body {
margin: 0;
padding: 0;
flex: 1;
display: flex;
}
#container {
display: flex;
flex: 1;
width: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.no-react-disclaimer {
margin: 16px;
font-family: Courier, monospace, serif;
font-size: 16px;
animation: fadeIn .5s ease-in-out forwards;
}
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@media (prefers-color-scheme: dark) {
:root {
color-scheme: dark;
}
@supports (-moz-appearance:none) {
:root {
background: black;
}
body {
color: white;
}
}
}
</style>
</head>
<body>
<!-- main react mount point -->
<div id="container">
<h1 class="no-react-disclaimer">Looks like this page doesn't have React, or it hasn't been loaded yet.</h1>
</div>
<script src="./build/panel.js"></script>
</body>
</html>

View File

@@ -0,0 +1,28 @@
<script src="shared.js"></script>
<link rel="stylesheet" href="shared.css" />
<style>
html, body {
min-width: 460px;
min-height: 133px;
}
hr {
width: 100%;
}
</style>
<p>
<b>This page includes an extra development build of React. &#x1f6a7;</b>
</p>
<p>
The React build on this page includes both development and production versions because dead code elimination has not been applied correctly.
<br />
<br />
This makes its size larger, and causes React to run slower.
<br />
<br />
Make sure to <a href="https://reactjs.org/docs/optimizing-performance.html#use-the-production-build">set up dead code elimination</a> before deployment.
</p>
<hr />
<p>
Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
</p>

View File

@@ -0,0 +1,24 @@
<script src="shared.js"></script>
<link rel="stylesheet" href="shared.css" />
<style>
html, body {
min-width: 460px;
min-height: 101px;
}
hr {
width: 100%;
}
</style>
<p>
<b>This page is using the development build of React. &#x1f6a7;</b>
</p>
<p>
Note that the development build is not suitable for production.
<br />
Make sure to <a href="https://reactjs.org/docs/optimizing-performance.html#use-the-production-build">use the production build</a> before deployment.
</p>
<hr />
<p>
Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
</p>

View File

@@ -0,0 +1,17 @@
<script src="shared.js"></script>
<link rel="stylesheet" href="shared.css" />
<style>
html, body {
min-width: 410px;
min-height: 33px;
}
hr {
width: 100%;
}
</style>
<p>
<b>This page doesn&rsquo;t appear to be using React.</b>
<br />
If this seems wrong, follow the <a href="https://github.com/facebook/react/tree/main/packages/react-devtools#the-react-tab-doesnt-show-up">troubleshooting instructions</a>.
</p>

View File

@@ -0,0 +1,25 @@
<script src="shared.js"></script>
<link rel="stylesheet" href="shared.css" />
<style>
html, body {
min-width: 460px;
min-height: 117px;
}
hr {
width: 100%;
}
</style>
<p>
<b>This page is using an outdated version of React. &#8987;</b>
</p>
<p>
We recommend updating React to ensure that you receive important bugfixes and performance improvements.
<br />
<br />
You can find the upgrade instructions on the <a href="https://reactjs.org/blog/">React blog</a>.
</p>
<hr />
<p>
Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
</p>

View File

@@ -0,0 +1,17 @@
<script src="shared.js"></script>
<link rel="stylesheet" href="shared.css" />
<style>
html, body {
min-width: 460px;
min-height: 39px;
}
hr {
width: 100%;
}
</style>
<p>
<b>This page is using the production build of React. &#x2705;</b>
<br />
Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
</p>

View File

@@ -0,0 +1,14 @@
<script src="shared.js"></script>
<link rel="stylesheet" href="shared.css" />
<style>
html, body {
min-width: 286px;
min-height: 33px;
}
</style>
<p>
<b>This is a restricted browser page.</b>
<br />
React devtools cannot access this page.
</p>

View File

@@ -0,0 +1,23 @@
html, body {
font-size: 14px;
}
body {
margin: 8px;
}
@media (prefers-color-scheme: dark) {
:root {
color-scheme: dark;
}
@supports (-moz-appearance:none) {
:root {
background: black;
}
body {
color: white;
}
}
}

View File

@@ -0,0 +1,25 @@
/* globals chrome */
'use strict';
document.addEventListener('DOMContentLoaded', function () {
// Make links work
const links = document.getElementsByTagName('a');
for (let i = 0; i < links.length; i++) {
(function () {
const ln = links[i];
const location = ln.href;
ln.onclick = function () {
chrome.tabs.create({active: true, url: location});
return false;
};
})();
}
// Work around https://bugs.chromium.org/p/chromium/issues/detail?id=428044
document.body.style.opacity = 0;
document.body.style.transition = 'opacity ease-out .4s';
requestAnimationFrame(function () {
document.body.style.opacity = 1;
});
});

View File

@@ -0,0 +1,31 @@
<script src="shared.js"></script>
<style>
html, body {
font-size: 14px;
min-width: 460px;
min-height: 133px;
}
body {
margin: 8px;
}
hr {
width: 100%;
}
</style>
<p>
<b>This page is using an unminified build of React. &#x1f6a7;</b>
</p>
<p>
The React build on this page appears to be unminified.
<br />
This makes its size larger, and causes React to run slower.
<br />
<br />
Make sure to <a href="https://reactjs.org/docs/optimizing-performance.html#use-the-production-build">set up minification</a> before deployment.
</p>
<hr />
<p>
Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
</p>

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Jason Costello
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,34 @@
# ![alt text](https://raw.githubusercontent.com/jin/chromelens/master/images/logo.png "ChromeLens Logo")
<a href="https://chrome.google.com/webstore/detail/chrome-lens/idikgljglpfilbhaboonnpnnincjhjkd">Chrome Web Store</a>
ChromeLens is a Google Chrome extension that provides a suite of tools to help
with web accessibility development.
### Lens (Vision Simulator)
Interact with a website as a completely/partially blind or a colorblind person.
### Accessibility Audit
Run a website through an series of accessibility rules and easily discover
elements in your website that do not comply with them.
### Tab-tracker
Key website features should be navigable solely via the keyboard (tab button),
while not making the user jump through hoops to get to a feature. With the
tab-tracker, you can visually track the flow of navigation through a website.
### Website
Find out more about ChromeLens, why we made it, and more about the extension at <a href="http://chromelens.xyz">chromelens.xyz</a>
### Credits
- https://github.com/GoogleChrome/accessibility-developer-tools
- https://github.com/niklasvh/html2canvas
- https://github.com/Altreus/colourblind
### Reviews for ChromeLens
- http://briancoords.com/tech/analyzing-accessibility-chromelens/
- http://www.jaredrigby.co.uk/2016/07/11/accessibility-testing-with-chromelens.html

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
var base = document.getElementById("chrome-lens-base")
if (base) { base.remove(); }

View File

@@ -0,0 +1,236 @@
var BASE_Z = 999999;
var WARNING_COUNT = 0;
var idToWarningsMap = {};
var STYLE = `<style>
:host {
all: initial;
contain: style layout size;
display: block;
position: absolute;
top: 0;
left: 0;
z-index: ${BASE_Z};
}
.chrome-lens-warning {
position: absolute;
box-shadow: 0 0 4px 4px #f7983a;
border-radius: 2px;
}
.tooltip .tooltip-text {
visibility: hidden;
display: inline-block;
background-color: #fffdfd;
color: #212121;
position: absolute;
max-width: 300px;
min-width: 200px;
padding: 0px 10px 5px 10px;
border-radius: 2px;
border: 1px solid black;
z-index: ${BASE_Z+1};
}
.tooltip .tooltip-text .severe {
color: #c10f0f;
font-weight: 900;
}
.tooltip .tooltip-text .warning {
color: #e69808;
font-weight: 700;
}
.tooltip:hover .tooltip-text {
visibility: visible;
}
</style>`;
var CHROME_LENS_BASE_ID = 'chrome-lens-base'
var CHROME_LENS_WARNING_CLASS = 'chrome-lens-warning'
var WARNING_ATTR_NAME = 'chromelens-warning-id';
function initDom() {
if (!document.getElementById(CHROME_LENS_BASE_ID)) {
const div = document.createElement('div');
div.id = CHROME_LENS_BASE_ID;
var root = div.attachShadow({mode: 'open'});
root.innerHTML = STYLE;
document.body.appendChild(div);
}
}
function tooltipHeader(severity, code, url) {
const el = document.createElement('p');
const severityEl = document.createElement('span');
if (severity === 'Severe') {
severityEl.className = 'severe'
} else if (severity === 'Warning') {
severityEl.className = 'warning'
}
severityEl.innerText = severity;
const codeLink = document.createElement('a');
codeLink.href = url;
codeLink.innerText = code;
codeLink.target = '_blank';
el.appendChild(severityEl);
el.appendChild(document.createTextNode(' '));
el.appendChild(codeLink);
return el;
}
function positionTooltip(tooltipText, el_top, el_left, el_height) {
const {width, height} = tooltipText.getBoundingClientRect();
if (height < el_top) {
// tooltip cannot fit above, make it below
tooltipText.style.bottom = el_height + 'px';
} else {
// tooltip goes above
tooltipText.style.top = el_height + 'px';
}
if (el_left + width > document.documentElement.clientWidth) {
// tooltip is wider than the el, right align el and tooltip
tooltipText.style.right = 0 + 'px';
}
}
function tooltipTextNode(rule_violated) {
const {code, heading, name, severity, url} = rule_violated;
const tooltipText = document.createElement('div');
tooltipText.className = 'tooltip-text';
tooltipText.appendChild(tooltipHeader(severity, code, url));
tooltipText.appendChild(document.createTextNode(heading));
suggestFix(rule_violated);
return tooltipText;
}
function getCoordinates(elem) {
var box = elem.getBoundingClientRect();
var body = document.body;
var docEl = document.documentElement;
var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;
var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;
var clientTop = docEl.clientTop || body.clientTop || 0;
var clientLeft = docEl.clientLeft || body.clientLeft || 0;
var top = box.top + scrollTop - clientTop;
var left = box.left + scrollLeft - clientLeft;
return { top, left, height: box.height, width: box.width }
}
function tooltipNode(offendingEl) {
const { top, left, height, width} = getCoordinates(offendingEl);
const div = document.createElement('div');
div.className = CHROME_LENS_WARNING_CLASS;
div.classList.add('tooltip');
div.style.left = left + 'px';
div.style.top = top + 'px';
div.style.width = width + 'px';
div.style.height = height + 'px';
// this id will be useful if we want to reference specific warnings emitted
div.id = 'chrome-lens-warning-' + WARNING_COUNT;
div.onmouseover = function() {
chrome.runtime.sendMessage({
type: 'HIGHLIGHT_REPORT',
data: {
warningId: div.id
}
})
}
div.onmouseout = function() {
chrome.runtime.sendMessage({
type: 'UNHIGHLIGHT_REPORT',
data: {
warningId: div.id
}
})
}
return div;
}
function suggestFix(ruleViolated) {
const {code, heading, name, severity, url} = ruleViolated;
if (code === 'AX_ARIA_10') {
}
}
function highlightElementForRuleViolation(frag, el, rule_violated) {
const warningId = CHROME_LENS_WARNING_CLASS + '-' + (WARNING_COUNT++);
idToWarningsMap[warningId] = {el: el, rule: rule_violated};
el.setAttribute(WARNING_ATTR_NAME, warningId);
const { top, left, height, width } = getCoordinates(el);
// if this isn't visible let's not warn about
if (top < 0 || left < 0) return;
const tooltipText = tooltipTextNode(rule_violated);
const toolTip = tooltipNode(el);
toolTip.appendChild(tooltipText);
frag.appendChild(toolTip);
// we can only position after we append, because tooltipText has no
// bounding client rect before it gets added to the DOM
positionTooltip(tooltipText, top, left, height);
}
function run() {
const base = document.getElementById(CHROME_LENS_BASE_ID);
if (base) {
base.remove()
}
var run_result = axs.Audit.run();
initDom()
var frag = document.createDocumentFragment();
// we only want to highlight failures
const failures = run_result.filter(v => v.result === 'FAIL');
failures.forEach(function(v) {
v.elements.forEach(function(el) {
highlightElementForRuleViolation(frag, el, v.rule);
})
})
var root = document.getElementById(CHROME_LENS_BASE_ID).shadowRoot;
root.appendChild(frag);
chrome.runtime.sendMessage({
type: 'AXS_COMPLETE',
data: {
result: failures,
idToWarningsMap,
}
})
}
run();
chrome.runtime.onMessage.addListener(function(message) {
switch (message.type) {
case 'HIGHLIGHT_WARNING': {
const { warningId } = message.data;
const warningTooltip = document.querySelector('#' + warningId + ' .tooltip-text');
if (!warningTooltip) { return; }
warningTooltip.style.visibility = 'visible';
break;
}
case 'UNHIGHLIGHT_WARNING': {
const { warningId } = message.data;
const warningTooltip = document.querySelector('#' + warningId + ' .tooltip-text');
if (!warningTooltip) { return; }
// we must set to null so that CSS can take over
warningTooltip.style.visibility = null;
break;
}
default:{
break;
}
}
})

View File

@@ -0,0 +1,116 @@
const messageType = {
EXECUTE_SCRIPT: 'EXECUTE_SCRIPT',
RUN_AXS: 'RUN_AXS',
AXS_COMPLETE: 'AXS_COMPLETE',
HIGHLIGHT_WARNING: 'HIGHLIGHT_WARNING',
UNHIGHLIGHT_WARNING: 'UNHIGHLIGHT_WARNING',
HIGHLIGHT_REPORT: 'HIGHLIGHT_REPORT',
UNHIGHLIGHT_REPORT: 'UNHIGHLIGHT_REPORT',
TRACE_TAB_PATH: 'TRACE_TAB_PATH',
PNG_TAB_PATH: 'PNG_TAB_PATH',
CLEAR_AXS: 'CLEAR_AXS'
}
const auditDir = 'audit';
const tracerDir = 'tracer';
var devtools = null;
const devToolsListener = function(message, sender, sendResponse) {
switch (message.type) {
case messageType.EXECUTE_SCRIPT: {
const { scriptToInject } = message.data;
// Inject a content script into the active tab
chrome.tabs.executeScript({file: scriptToInject});
break;
}
case messageType.RUN_AXS: {
chrome.tabs.executeScript({ file: `${auditDir}/axs_testing.js` });
chrome.tabs.executeScript({ file: `${auditDir}/run_axs.js` });
break;
}
case messageType.CLEAR_AXS: {
chrome.tabs.executeScript({ file: `${auditDir}/clear_axs.js`})
break;
}
case messageType.AXS_COMPLETE: {
const { result, idToWarningsMap } = message.data;
if (devtools) {
devtools.postMessage({
type: 'AXS_SHOW_RESULTS',
data: {
idToWarningsMap: idToWarningsMap
}
})
}
break;
}
case messageType.HIGHLIGHT_WARNING: {
const { warningId } = message.data;
chrome.tabs.sendMessage({
type: messageType.HIGHLIGHT_WARNING,
data: {
warningId: warningId
}
})
break;
}
case messageType.UNHIGHLIGHT_WARNING: {
const { warningId } = message.data;
chrome.tabs.sendMessage({
type: messageType.UNHIGHLIGHT_WARNING,
data: {
warningId: warningId
}
})
break;
}
case messageType.HIGHLIGHT_REPORT: {
const { warningId } = message.data;
if (devtools) {
devtools.postMessage({
type: messageType.HIGHLIGHT_REPORT,
data: {
warningId: warningId
}
})
}
break;
}
case messageType.UNHIGHLIGHT_REPORT: {
const { warningId } = message.data;
if (devtools) {
devtools.postMessage({
type: messageType.UNHIGHLIGHT_REPORT,
data: {
warningId: warningId
}
})
}
break;
}
case messageType.TRACE_TAB_PATH: {
chrome.tabs.executeScript({ file: `${tracerDir}/trace_tab_path.js` });
break;
}
case messageType.PNG_TAB_PATH: {
chrome.tabs.executeScript({ file: `${tracerDir}/html2canvas.js` });
chrome.tabs.executeScript({ file: `${tracerDir}/png_tab_path.js` });
break;
}
default: {
console.log(message);
return null;
}
}
}
// might need to change this to be inside onConnect, and on devtools side
// pass the port to panel
chrome.runtime.onMessage.addListener(devToolsListener);
chrome.runtime.onConnect.addListener(function(devToolsConnection) {
// devToolsConnection.onMessage.addListener(devToolsListener);
devtools = devToolsConnection;
// assign the listener function to a variable so we can remove it later
// add the listener
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -0,0 +1,11 @@
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = '<svg style="display: none" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
'<filter id="achromatomaly"> ' +
'<feColorMatrix type="matrix" values="0.618,0.320,0.062,0,0,0.163,0.775,0.062,0,0,0.163,0.320,0.516,0,0,0,0,0,1,0" in="SourceGraphic" /> ' +
'</filter> ' +
'</svg>';
document.body.appendChild(iDiv);
document.body.style.filter = "url(#achromatomaly)";
document.body.style.webkitFilter = "url(#achromatomaly)";

View File

@@ -0,0 +1,11 @@
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = '<svg style="display: none" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
'<filter id="achromatopsia"> ' +
'<feColorMatrix type="matrix" values="0.299,0.587,0.114,0,0,0.299,0.587,0.114,0,0,0.299,0.587,0.114,0,0,0,0,0,1,0" in="SourceGraphic" /> ' +
'</filter> ' +
'</svg>';
document.body.appendChild(iDiv);
document.body.style.filter = "url(#achromatopsia)";
document.body.style.webkitFilter = "url(#achromatopsia)";

View File

@@ -0,0 +1,11 @@
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = '<svg style="display: none" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
'<filter id="deuteranomaly"> ' +
'<feColorMatrix type="matrix" values="0.8,0.2,0,0,0,0.258,0.742,0,0,0,0,0.142,0.858,0,0,0,0,0,1,0" in="SourceGraphic" /> ' +
'</filter> ' +
'</svg>';
document.body.appendChild(iDiv);
document.body.style.filter = "url(#deuteranomaly)";
document.body.style.webkitFilter = "url(#deuteranomaly)";

View File

@@ -0,0 +1,11 @@
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = '<svg style="display: none" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
'<filter id="deuteranopia"> ' +
'<feColorMatrix type="matrix" values="0.625,0.375,0,0,0,0.7,0.3,0,0,0,0,0.3,0.7,0,0,0,0,0,1,0" in="SourceGraphic" /> ' +
'</filter> ' +
'</svg>';
document.body.appendChild(iDiv);
document.body.style.filter = "url(#deuteranopia)";
document.body.style.webkitFilter = "url(#deuteranopia)";

View File

@@ -0,0 +1,2 @@
document.body.style.filter = "";
document.body.style.webkitFilter = "";

View File

@@ -0,0 +1,20 @@
delete document.body.style.filter;
delete document.body.style.webkitFilter;
// z-index at upper bound of 32bit int
var styles = `
background-color: black;
pointer-events: none;
top: 0;
left: 0;
height: 100%;
width: 100%;
position: fixed;
z-index: 2147483647;
`
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = `<div style="${styles}"></div>`;
document.body.appendChild(iDiv);

View File

@@ -0,0 +1,20 @@
document.body.style.filter = "blur(3px)";
document.body.style.webkitFilter = "blur(3px)";
// z-index at upper bound of 32bit int
var styles = `
background: rgba(50, 50, 50, 0.3);
pointer-events: none;
top: 0;
left: 0;
height: 100%;
width: 100%;
position: fixed;
z-index: 2147483647;
`
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = `<div style="${styles}"></div>`;
document.body.appendChild(iDiv);

View File

@@ -0,0 +1,20 @@
document.body.style.filter = "blur(2px)";
document.body.style.webkitFilter = "blur(2px)";
// z-index at upper bound of 32bit int
var styles = `
background: rgba(50, 50, 50, 0.1);
pointer-events: none;
top: 0;
left: 0;
height: 100%;
width: 100%;
position: fixed;
z-index: 2147483647;
`
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = `<div style="${styles}"></div>`;
document.body.appendChild(iDiv);

View File

@@ -0,0 +1,2 @@
document.body.style.filter = "blur(1px)";
document.body.style.webkitFilter = "blur(1px)";

View File

@@ -0,0 +1,20 @@
document.body.style.filter = "blur(10px)";
document.body.style.webkitFilter = "blur(10px)";
// z-index at upper bound of 32bit int
var styles = `
background: rgba(50, 50, 50, 0.5);
pointer-events: none;
top: 0;
left: 0;
height: 100%;
width: 100%;
position: fixed;
z-index: 2147483647;
`
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = `<div style="${styles}"></div>`;
document.body.appendChild(iDiv);

View File

@@ -0,0 +1,11 @@
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = '<svg style="display: none" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
'<filter id="protanomaly"> ' +
'<feColorMatrix type="matrix" values="0.817,0.183,0,0,0,0.333,0.667,0,0,0,0,0.125,0.875,0,0,0,0,0,1,0" in="SourceGraphic" /> ' +
'</filter> ' +
'</svg>';
document.body.appendChild(iDiv);
document.body.style.filter = "url(#protanomaly)";
document.body.style.webkitFilter = "url(#protanomaly)";

View File

@@ -0,0 +1,11 @@
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = '<svg style="display: none" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
'<filter id="protanopia"> ' +
'<feColorMatrix type="matrix" values="0.567,0.433,0,0,0,0.558,0.442,0,0,0,0,0.242,0.758,0,0,0,0,0,1,0" in="SourceGraphic" /> ' +
'</filter> ' +
'</svg>';
document.body.appendChild(iDiv);
document.body.style.filter = "url(#protanopia)";
document.body.style.webkitFilter = "url(#protanopia)";

View File

@@ -0,0 +1,11 @@
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = '<svg style="display: none" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
'<filter id="tritanomaly"> ' +
'<feColorMatrix type="matrix" values="0.967,0.033,0,0,0,0,0.733,0.267,0,0,0,0.183,0.817,0,0,0,0,0,1,0" in="SourceGraphic" /> ' +
'</filter> ' +
'</svg>';
document.body.appendChild(iDiv);
document.body.style.filter = "url(#tritanomaly)";
document.body.style.webkitFilter = "url(#tritanomaly)";

View File

@@ -0,0 +1,11 @@
var iDiv = document.createElement('div');
iDiv.id = 'chromelens-colorFilters';
iDiv.innerHTML = '<svg style="display: none" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
'<filter id="tritanopia"> ' +
'<feColorMatrix type="matrix" values="0.95,0.05,0,0,0,0,0.433,0.567,0,0,0,0.475,0.525,0,0,0,0,0,1,0" in="SourceGraphic" /> ' +
'</filter> ' +
'</svg>';
document.body.appendChild(iDiv);
document.body.style.filter = "url(#tritanopia)";
document.body.style.webkitFilter = "url(#tritanopia)";

View File

@@ -0,0 +1,4 @@
var elem = document.getElementById("chromelens-colorFilters");
if (elem) {
elem.parentElement.removeChild(elem);
}

View File

@@ -0,0 +1,8 @@
<!doctype html>
<html>
<head>
<script src="main.js"></script>
</head>
<body>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More