1- const Bridge = require ( "crx-bridge" ) . default ;
1+ // const Bridge = require("crx-bridge").default;
22
3- async function main ( ) {
4- //need to establish connection between background & contentScript.
5- await Bridge . sendMessage ( "connect" , { really : true } , "content-script" ) ;
6- }
3+ // async function main() {
4+ // //need to establish connection between background & contentScript.
5+ // await Bridge.sendMessage("connect", { really: true }, "content-script");
6+ // }
77
8- main ( ) ;
8+ // main();
99
1010chrome . devtools . panels . create (
1111 "Which Query?" ,
@@ -14,25 +14,27 @@ chrome.devtools.panels.create(
1414) ;
1515
1616chrome . devtools . panels . elements . createSidebarPane ( "Which Query?" , ( sidebar ) => {
17- Bridge . onMessage (
18- "show-suggestion" ,
19- ( { data : { suggestedQuery, exactIndex, length } } ) => {
20- const isExact = exactIndex >= 0 ;
21- if ( length > 1 ) {
22- suggestedQuery = suggestedQuery . replace ( "get" , "getAll" ) ;
17+ sidebar . setPage ( "pages/elements-panel.html" ) ;
18+ // Bridge.onMessage(
19+ // "show-suggestion",
20+ // ({ data: { suggestedQuery, exactIndex, length } }) => {
21+ // const isExact = exactIndex >= 0;
22+ // if (length > 1) {
23+ // suggestedQuery = suggestedQuery.replace("get", "getAll");
2324
24- if ( isExact ) {
25- suggestedQuery += `[${ exactIndex } ]` ;
26- }
27- }
28- sidebar . setObject (
29- { suggestedQuery } ,
30- isExact
31- ? "This query will get this precise element"
32- : "{!} Closest available query, try improving a11y of this element.."
33- ) ;
34- }
35- ) ;
25+ // if (isExact) {
26+ // suggestedQuery += `[${exactIndex}]`;
27+ // }
28+ // }
29+ // console.log(suggestedQuery)
30+ // // sidebar.setObject(
31+ // // { suggestedQuery },
32+ // // isExact
33+ // // ? "This query will get this precise element"
34+ // // : "{!} Closest available query, try improving a11y of this element.."
35+ // // );
36+ // }
37+ // );
3638 chrome . devtools . panels . elements . onSelectionChanged . addListener ( ( ) => {
3739 chrome . devtools . inspectedWindow . eval ( "window.showElement($0)" , {
3840 useContentScriptContext : true ,
0 commit comments