-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.html
More file actions
30 lines (28 loc) · 1.01 KB
/
Copy pathdebug.html
File metadata and controls
30 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
<title>Extension Debug</title>
</head>
<body>
<h1>Extension Debug Page</h1>
<button id="testButton">Test Background Communication</button>
<div id="result"></div>
<script>
document.getElementById('testButton').addEventListener('click', () => {
console.log('Testing background communication...');
chrome.runtime.sendMessage({
action: 'test',
message: 'Hello from debug page'
}, (response) => {
if (chrome.runtime.lastError) {
console.error('Error:', chrome.runtime.lastError);
document.getElementById('result').textContent = 'Error: ' + chrome.runtime.lastError.message;
} else {
console.log('Response:', response);
document.getElementById('result').textContent = 'Success: ' + JSON.stringify(response);
}
});
});
</script>
</body>
</html>