-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.js
More file actions
26 lines (23 loc) · 845 Bytes
/
content.js
File metadata and controls
26 lines (23 loc) · 845 Bytes
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
// Content script for Tab to Localhost extension
// This could be used for page-specific features if needed
// Listen for messages from popup or background script
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.action === 'getPageInfo') {
// Return page information if needed
sendResponse({
url: window.location.href,
title: document.title,
domain: window.location.hostname
});
}
});
// Optional: Add visual indicator when extension is active
function addVisualIndicator() {
if (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') {
// Could add a small indicator that this is a localhost page
// For now, just log to console
console.log('Tab to Localhost: Running on localhost');
}
}
// Initialize
addVisualIndicator();