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

View File

@@ -0,0 +1,46 @@
// Utilities
function log(...s) {
const string = JSON.stringify(s);
chrome.devtools.inspectedWindow.eval('console.log(' + string + ')')
};
// Create panel
function createPanel() {
chrome.devtools.panels.create('ChromeLens', '', 'panel.html', function(panel) {
var _window;
var backgroundPageConnection = chrome.runtime.connect();
backgroundPageConnection.onMessage.addListener(function (message) {
// Handle responses from the background page, if any
switch (message.type) {
case 'AXS_SHOW_RESULTS': {
const { idToWarningsMap } = message.data;
if (_window) {
_window.showAxsResults(idToWarningsMap);
}
break;
}
case 'HIGHLIGHT_REPORT': {
const { warningId } = message.data;
if (_window) {
_window.highlightReportLine(warningId);
}
break;
}
case 'UNHIGHLIGHT_REPORT': {
const { warningId } = message.data;
if (_window) {
_window.unhighlightReportLine(warningId);
}
break;
}
}
});
panel.onShown.addListener(function(window) {
_window = window;
});
panel.onHidden.addListener(function() {
});
})
}
createPanel();