bbc123321 commited on
Commit
22be3f8
·
verified ·
1 Parent(s): 40296ec

Only Wikipedia is working. The UI is trash. Make it red and black and the main screen is what you search with a tab for configuration. Please fix the proxy and literally everything that is broken.

Browse files
Files changed (4) hide show
  1. components/navbar.js +71 -94
  2. components/tabs.js +164 -0
  3. index.html +30 -41
  4. script.js +112 -108
components/navbar.js CHANGED
@@ -1,97 +1,74 @@
 
1
  class CustomNavbar extends HTMLElement {
2
- connectedCallback() {
3
- this.attachShadow({ mode: 'open' });
4
- this.shadowRoot.innerHTML = `
5
- <style>
6
- :host {
7
- display: block;
8
- width: 100%;
9
- background-color: rgba(17, 24, 39, 0.95);
10
- backdrop-filter: blur(8px);
11
- position: sticky;
12
- top: 0;
13
- z-index: 50;
14
- border-bottom: 1px solid rgba(255, 255, 255, 0.1);
15
- }
16
- .nav-container {
17
- max-width: 100%;
18
- margin: 0 auto;
19
- padding: 0.75rem 1rem;
20
- display: flex;
21
- align-items: center;
22
- justify-content: space-between;
23
- }
24
- .logo {
25
- display: flex;
26
- align-items: center;
27
- font-weight: 700;
28
- font-size: 1.25rem;
29
- }
30
- .logo-icon {
31
- margin-right: 0.5rem;
32
- color: #60a5fa;
33
- }
34
- .nav-items {
35
- display: flex;
36
- align-items: center;
37
- gap: 1rem;
38
- }
39
- .nav-link {
40
- display: flex;
41
- align-items: center;
42
- padding: 0.5rem 1rem;
43
- border-radius: 0.375rem;
44
- transition: all 0.2s;
45
- color: rgba(156, 163, 175, 1);
46
- font-weight: 500;
47
- }
48
- .nav-link:hover {
49
- color: white;
50
- background-color: rgba(31, 41, 55, 0.5);
51
- }
52
- .proxy-indicator {
53
- display: flex;
54
- align-items: center;
55
- padding: 0.25rem 0.75rem;
56
- border-radius: 9999px;
57
- background-color: rgba(59, 130, 246, 0.1);
58
- color: #60a5fa;
59
- font-size: 0.875rem;
60
- margin-right: 1rem;
61
- }
62
- .proxy-icon {
63
- margin-right: 0.25rem;
64
- width: 0.875rem;
65
- height: 0.875rem;
66
- }
67
- </style>
68
- <div class="nav-container">
69
- <a href="/" class="logo">
70
- <i data-feather="anchor" class="logo-icon"></i>
71
- ProxyPirate
72
- </a>
73
-
74
- <div class="nav-items">
75
- <div class="proxy-indicator hidden">
76
- <i data-feather="shield" class="proxy-icon"></i>
77
- Proxy Active
78
- </div>
79
- <a href="/" class="nav-link">
80
- <i data-feather="home" class="mr-2"></i>
81
- Home
82
- </a>
83
- <a href="javascript:void(0)" class="nav-link" id="toggle-vpn">
84
- <i data-feather="shield" class="mr-2"></i>
85
- VPN
86
- </a>
87
- <a href="javascript:void(0)" class="nav-link" id="clear-cookies">
88
- <i data-feather="trash-2" class="mr-2"></i>
89
- Clear Data
90
- </a>
91
- </div>
92
- </div>
93
- `;
94
- }
95
  }
96
 
97
- customElements.define('custom-navbar', CustomNavbar);
 
1
+
2
  class CustomNavbar extends HTMLElement {
3
+ connectedCallback() {
4
+ this.attachShadow({ mode: 'open' });
5
+ this.shadowRoot.innerHTML = `
6
+ <style>
7
+ :host {
8
+ display: block;
9
+ width: 100%;
10
+ background-color: #0F0F0F;
11
+ position: sticky;
12
+ top: 0;
13
+ z-index: 50;
14
+ border-bottom: 1px solid #8B0000;
15
+ }
16
+ .nav-container {
17
+ max-width: 100%;
18
+ margin: 0 auto;
19
+ padding: 1rem;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: space-between;
23
+ }
24
+ .logo {
25
+ display: flex;
26
+ align-items: center;
27
+ font-weight: 700;
28
+ font-size: 1.5rem;
29
+ color: #FF0000;
30
+ text-decoration: none;
31
+ }
32
+ .logo-icon {
33
+ margin-right: 0.5rem;
34
+ color: #FF0000;
35
+ }
36
+ .status {
37
+ display: flex;
38
+ align-items: center;
39
+ font-size: 0.875rem;
40
+ }
41
+ .status-item {
42
+ margin-left: 1rem;
43
+ padding: 0.25rem 0.5rem;
44
+ border-radius: 0.25rem;
45
+ background: #1F1F1F;
46
+ color: #FF0000;
47
+ display: flex;
48
+ align-items: center;
49
+ }
50
+ .status-icon {
51
+ margin-right: 0.25rem;
52
+ }
53
+ </style>
54
+ <div class="nav-container">
55
+ <a href="/" class="logo">
56
+ <i data-feather="droplet" class="logo-icon"></i>
57
+ BloodProxy
58
+ </a>
59
+ <div class="status">
60
+ <div class="status-item" id="proxy-status">
61
+ <i data-feather="shield" class="status-icon"></i>
62
+ <span>Proxy: Off</span>
63
+ </div>
64
+ <div class="status-item" id="vpn-status">
65
+ <i data-feather="lock" class="status-icon"></i>
66
+ <span>VPN: Off</span>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ `;
71
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  }
73
 
74
+ customElements.define('custom-navbar', CustomNavbar);
components/tabs.js ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomTabs extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ :host {
7
+ display: block;
8
+ margin-bottom: 1rem;
9
+ }
10
+ .tabs-container {
11
+ display: flex;
12
+ border-bottom: 2px solid #8B0000;
13
+ }
14
+ .tab {
15
+ padding: 0.75rem 1.5rem;
16
+ background: #0F0F0F;
17
+ color: #7F7F7F;
18
+ border: none;
19
+ border-radius: 0.5rem 0.5rem 0 0;
20
+ margin-right: 0.5rem;
21
+ font-weight: 600;
22
+ cursor: pointer;
23
+ transition: all 0.2s;
24
+ display: flex;
25
+ align-items: center;
26
+ }
27
+ .tab:hover {
28
+ color: #FF0000;
29
+ }
30
+ .tab.active {
31
+ background: #8B0000;
32
+ color: white;
33
+ }
34
+ .tab i {
35
+ margin-right: 0.5rem;
36
+ }
37
+ .tab-close {
38
+ margin-left: 0.5rem;
39
+ width: 16px;
40
+ height: 16px;
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ border-radius: 50%;
45
+ opacity: 0.7;
46
+ }
47
+ .tab-close:hover {
48
+ background: rgba(255,255,255,0.2);
49
+ opacity: 1;
50
+ }
51
+ .tab-content {
52
+ display: none;
53
+ padding: 1rem;
54
+ background: #0F0F0F;
55
+ border-radius: 0 0.5rem 0.5rem 0.5rem;
56
+ }
57
+ .tab-content.active {
58
+ display: block;
59
+ }
60
+ </style>
61
+ <div class="tabs-container">
62
+ <button class="tab active" data-tab="browser">
63
+ <i data-feather="compass"></i> Browser
64
+ </button>
65
+ <button class="tab" data-tab="settings">
66
+ <i data-feather="settings"></i> Settings
67
+ </button>
68
+ <button class="tab" data-tab="privacy">
69
+ <i data-feather="shield"></i> Privacy
70
+ </button>
71
+ </div>
72
+
73
+ <div id="browser-content" class="tab-content active">
74
+ <div class="flex mb-4">
75
+ <input
76
+ type="text"
77
+ id="url-input"
78
+ class="flex-1 bg-black border border-blood rounded-l-lg px-4 py-2 text-white focus:outline-none focus:ring-2 focus:ring-blood"
79
+ placeholder="Enter URL (e.g. https://example.com)"
80
+ >
81
+ <button id="go-button" class="bg-blood px-4 py-2 rounded-r-lg font-bold hover:bg-red-800">
82
+ GO
83
+ </button>
84
+ </div>
85
+ </div>
86
+
87
+ <div id="settings-content" class="tab-content">
88
+ <div class="space-y-4">
89
+ <div class="flex items-center">
90
+ <input type="checkbox" id="proxy-toggle" class="rounded bg-black border-blood text-blood">
91
+ <label for="proxy-toggle" class="ml-2">Enable Proxy</label>
92
+ </div>
93
+ <div id="proxy-settings" class="hidden">
94
+ <div class="mb-2">
95
+ <label class="block text-sm mb-1">Proxy Server</label>
96
+ <input type="text" id="proxy-server" class="w-full bg-black border border-blood rounded px-3 py-2 text-white">
97
+ </div>
98
+ </div>
99
+ </div>
100
+ </div>
101
+
102
+ <div id="privacy-content" class="tab-content">
103
+ <div class="space-y-3">
104
+ <button id="clear-data" class="w-full bg-black hover:bg-blood border border-blood rounded px-4 py-2 flex items-center">
105
+ <i data-feather="trash-2" class="mr-2"></i> Clear Browsing Data
106
+ </button>
107
+ <button id="toggle-vpn" class="w-full bg-black hover:bg-blood border border-blood rounded px-4 py-2 flex items-center">
108
+ <i data-feather="lock" class="mr-2"></i> Toggle VPN
109
+ </button>
110
+ </div>
111
+ </div>
112
+ `;
113
+
114
+ // Tab switching
115
+ const tabs = this.shadowRoot.querySelectorAll('.tab');
116
+ const contents = this.shadowRoot.querySelectorAll('.tab-content');
117
+
118
+ tabs.forEach(tab => {
119
+ tab.addEventListener('click', () => {
120
+ tabs.forEach(t => t.classList.remove('active'));
121
+ contents.forEach(c => c.classList.remove('active'));
122
+
123
+ tab.classList.add('active');
124
+ const tabId = tab.getAttribute('data-tab');
125
+ this.shadowRoot.getElementById(`${tabId}-content`).classList.add('active');
126
+ feather.replace();
127
+ });
128
+ });
129
+
130
+ // Proxy toggle
131
+ const proxyToggle = this.shadowRoot.getElementById('proxy-toggle');
132
+ const proxySettings = this.shadowRoot.getElementById('proxy-settings');
133
+
134
+ proxyToggle.addEventListener('change', () => {
135
+ proxySettings.classList.toggle('hidden', !proxyToggle.checked);
136
+ });
137
+
138
+ // URL navigation
139
+ const urlInput = this.shadowRoot.getElementById('url-input');
140
+ const goButton = this.shadowRoot.getElementById('go-button');
141
+
142
+ const handleNavigation = () => {
143
+ const url = urlInput.value.trim();
144
+ const useProxy = proxyToggle.checked;
145
+
146
+ if (url) {
147
+ this.dispatchEvent(new CustomEvent('navigate', {
148
+ detail: { url, useProxy },
149
+ bubbles: true,
150
+ composed: true
151
+ }));
152
+ }
153
+ };
154
+
155
+ goButton.addEventListener('click', handleNavigation);
156
+ urlInput.addEventListener('keypress', (e) => {
157
+ if (e.key === 'Enter') handleNavigation();
158
+ });
159
+
160
+ feather.replace();
161
+ }
162
+ }
163
+
164
+ customElements.define('custom-tabs', CustomTabs);
index.html CHANGED
@@ -1,57 +1,46 @@
 
1
  <!DOCTYPE html>
2
- <html lang="en" class="dark">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>ProxyPirate Browser 🏴‍☠️</title>
7
  <link rel="stylesheet" href="style.css">
8
  <script src="https://cdn.tailwindcss.com"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
  <script src="https://unpkg.com/feather-icons"></script>
11
  <script src="components/navbar.js"></script>
12
- <script src="components/proxy-form.js"></script>
13
- <script src="components/quick-links.js"></script>
14
  </head>
15
- <body class="bg-gray-900 text-gray-100 min-h-screen">
16
  <custom-navbar></custom-navbar>
17
 
18
- <main class="container mx-auto px-4 py-8">
19
- <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
20
- <div class="lg:col-span-2">
21
- <div class="bg-gray-800 rounded-xl shadow-2xl overflow-hidden">
22
- <iframe
23
- id="browser-frame"
24
- class="w-full h-[70vh] border-0"
25
- sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
26
- allowfullscreen
27
- ></iframe>
28
- </div>
29
-
30
- <custom-proxy-form class="mt-6"></custom-proxy-form>
31
- </div>
32
-
33
- <div class="lg:col-span-1">
34
- <custom-quick-links></custom-quick-links>
35
-
36
- <div class="bg-gray-800 rounded-xl p-6 mt-6">
37
- <h2 class="text-xl font-bold mb-4 flex items-center">
38
- <i data-feather="shield" class="mr-2"></i> Privacy Tools
39
- </h2>
40
- <div class="space-y-3">
41
- <a href="javascript:void(0)" class="flex items-center text-blue-400 hover:text-blue-300" id="toggle-vpn">
42
- <i data-feather="lock" class="mr-2"></i> Toggle VPN
43
- </a>
44
- <a href="javascript:void(0)" class="flex items-center text-blue-400 hover:text-blue-300" id="clear-data">
45
- <i data-feather="eye-off" class="mr-2"></i> Clear Data
46
- </a>
47
- <a href="https://privacytests.org" target="_blank" class="flex items-center text-blue-400 hover:text-blue-300">
48
- <i data-feather="shield" class="mr-2"></i> Privacy Test
49
- </a>
50
- </div>
51
- </div>
52
- </div>
53
  </div>
54
  </main>
 
55
  <script src="script.js"></script>
56
  </body>
57
- </html>
 
1
+
2
  <!DOCTYPE html>
3
+ <html lang="en">
4
  <head>
5
  <meta charset="UTF-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>BloodProxy Browser 🩸</title>
8
  <link rel="stylesheet" href="style.css">
9
  <script src="https://cdn.tailwindcss.com"></script>
10
+ <script>
11
+ tailwind.config = {
12
+ theme: {
13
+ extend: {
14
+ colors: {
15
+ blood: '#8B0000',
16
+ dark: '#0F0F0F',
17
+ accent: '#FF0000'
18
+ }
19
+ }
20
+ }
21
+ }
22
+ </script>
23
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
24
  <script src="https://unpkg.com/feather-icons"></script>
25
  <script src="components/navbar.js"></script>
26
+ <script src="components/tabs.js"></script>
 
27
  </head>
28
+ <body class="bg-dark text-white min-h-screen">
29
  <custom-navbar></custom-navbar>
30
 
31
+ <main class="container mx-auto px-4 py-4">
32
+ <custom-tabs></custom-tabs>
33
+
34
+ <div class="bg-black rounded-lg overflow-hidden shadow-lg shadow-blood/50">
35
+ <iframe
36
+ id="browser-frame"
37
+ class="w-full h-[80vh] border-0"
38
+ sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
39
+ allowfullscreen
40
+ ></iframe>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  </div>
42
  </main>
43
+
44
  <script src="script.js"></script>
45
  </body>
46
+ </html>
script.js CHANGED
@@ -1,118 +1,122 @@
1
 
2
  document.addEventListener('DOMContentLoaded', () => {
3
- const browserFrame = document.getElementById('browser-frame');
4
- const proxyForm = document.querySelector('custom-proxy-form');
 
 
 
 
 
 
 
 
5
 
6
- // Default page to load
7
- loadUrl('https://www.google.com');
 
 
8
 
9
- // Handle URL loading
10
- function loadUrl(url, useProxy = false) {
11
- try {
12
- browserFrame.classList.add('loading');
13
-
14
- // Validate URL
15
- if (!url.startsWith('http://') && !url.startsWith('https://')) {
16
- url = 'https://' + url;
17
- }
18
-
19
- // Create new URL object to validate
20
- new URL(url);
21
-
22
- if (useProxy) {
23
- // Use a more reliable proxy service
24
- const proxyUrl = `https://cors-anywhere.herokuapp.com/${url}`;
25
- browserFrame.src = proxyUrl;
26
- document.querySelectorAll('.proxy-indicator').forEach(el => el.classList.remove('hidden'));
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  } else {
28
- browserFrame.src = url;
29
- document.querySelectorAll('.proxy-indicator').forEach(el => el.classList.add('hidden'));
30
  }
31
-
32
- // Remove loading class when page is loaded
33
- browserFrame.onload = () => {
34
- browserFrame.classList.remove('loading');
35
- };
36
-
37
- browserFrame.onerror = () => {
38
- browserFrame.classList.remove('loading');
39
- browserFrame.srcdoc = `
40
- <html><body style="color:white;padding:2rem;background:#111827;">
41
- <h1>Failed to load page</h1>
42
- <p>Could not load ${url}</p>
43
- <p>Try enabling proxy or check your connection</p>
44
- </body></html>
45
- `;
46
- };
47
- } catch (error) {
48
- console.error('URL loading error:', error);
49
- browserFrame.classList.remove('loading');
50
- browserFrame.srcdoc = `
51
- <html><body style="color:white;padding:2rem;background:#111827;">
52
- <h1>Invalid URL</h1>
53
- <p>${url} is not a valid web address</p>
54
- <p>Please enter a complete URL like "https://example.com"</p>
55
- </body></html>
56
- `;
57
- }
 
 
 
 
 
 
 
 
 
58
  }
59
- // Handle proxy form submission
60
- proxyForm.addEventListener('proxy-submit', (e) => {
61
- const { url, useProxy } = e.detail;
62
- loadUrl(url, useProxy);
63
- });
64
-
65
- // Event delegation for dynamically added elements
66
- document.addEventListener('click', (e) => {
 
 
67
  if (e.target.closest('#toggle-vpn')) {
68
- const vpnActive = document.querySelector('.proxy-indicator').classList.contains('hidden');
69
- document.querySelectorAll('.proxy-indicator').forEach(el => {
70
- vpnActive ? el.classList.remove('hidden') : el.classList.add('hidden');
71
- el.innerHTML = `<i data-feather="shield" class="proxy-icon"></i> ${vpnActive ? 'VPN Active' : 'Proxy Active'}`;
72
- });
73
- feather.replace();
74
  }
75
- });
76
- // Handle quick link clicks
77
- document.addEventListener('quick-link-click', (e) => {
78
- loadUrl(e.detail.url, e.detail.useProxy);
79
- });
80
-
81
- // VPN toggle functionality
82
- const toggleVpnButtons = document.querySelectorAll('#toggle-vpn');
83
- let vpnActive = false;
84
-
85
- toggleVpnButtons.forEach(button => {
86
- button.addEventListener('click', () => {
87
- vpnActive = !vpnActive;
88
- const indicator = document.querySelector('.proxy-indicator');
89
- if (vpnActive) {
90
- indicator.classList.remove('hidden');
91
- indicator.innerHTML = `<i data-feather="shield" class="proxy-icon"></i> VPN Active`;
92
- feather.replace();
93
- } else {
94
- indicator.classList.add('hidden');
95
- }
96
- });
97
- });
98
- // Clear data functionality
99
- const clearDataButtons = document.querySelectorAll('#clear-data, #clear-cookies');
100
- clearDataButtons.forEach(button => {
101
- button.addEventListener('click', () => {
102
- if (confirm('Clear all browsing data (cookies, cache, etc.)?')) {
103
- const browserFrame = document.getElementById('browser-frame');
104
- browserFrame.src = 'about:blank';
105
- setTimeout(() => {
106
- loadUrl('https://www.google.com');
107
- alert('Browser data cleared!');
108
- }, 500);
109
- }
110
- });
111
- });
112
- // Initialize feather icons and reload after content changes
113
- const initFeather = () => {
114
- feather.replace();
115
- setTimeout(() => feather.replace(), 500); // Double init to catch dynamic elements
116
- };
117
- initFeather();
118
  });
 
1
 
2
  document.addEventListener('DOMContentLoaded', () => {
3
+ const browserFrame = document.getElementById('browser-frame');
4
+
5
+ // Proxy configuration
6
+ let proxyEnabled = false;
7
+ let vpnEnabled = false;
8
+
9
+ // Update status indicators
10
+ function updateStatus() {
11
+ const proxyStatus = document.querySelector('custom-navbar').shadowRoot.getElementById('proxy-status');
12
+ const vpnStatus = document.querySelector('custom-navbar').shadowRoot.getElementById('vpn-status');
13
 
14
+ proxyStatus.innerHTML = `
15
+ <i data-feather="shield" class="status-icon"></i>
16
+ <span>Proxy: ${proxyEnabled ? 'On' : 'Off'}</span>
17
+ `;
18
 
19
+ vpnStatus.innerHTML = `
20
+ <i data-feather="lock" class="status-icon"></i>
21
+ <span>VPN: ${vpnEnabled ? 'On' : 'Off'}</span>
22
+ `;
23
+
24
+ feather.replace();
25
+ }
26
+
27
+ // Load URL with error handling
28
+ function loadUrl(url, useProxy = false) {
29
+ try {
30
+ browserFrame.classList.add('loading');
31
+
32
+ // Validate URL
33
+ if (!url.startsWith('http://') && !url.startsWith('https://')) {
34
+ url = 'https://' + url;
35
+ }
36
+
37
+ // Create new URL object to validate
38
+ new URL(url);
39
+
40
+ if (useProxy || vpnEnabled) {
41
+ // Use a better proxy solution
42
+ const proxyUrl = `https://api.allorigins.win/get?url=${encodeURIComponent(url)}`;
43
+
44
+ fetch(proxyUrl)
45
+ .then(response => response.json())
46
+ .then(data => {
47
+ if (data.contents) {
48
+ browserFrame.srcdoc = data.contents;
49
+ proxyEnabled = true;
50
  } else {
51
+ throw new Error('Proxy request failed');
 
52
  }
53
+ })
54
+ .catch(() => {
55
+ // Fallback to direct if proxy fails
56
+ browserFrame.src = url;
57
+ proxyEnabled = false;
58
+ });
59
+ } else {
60
+ browserFrame.src = url;
61
+ proxyEnabled = false;
62
+ }
63
+
64
+ browserFrame.onload = () => {
65
+ browserFrame.classList.remove('loading');
66
+ updateStatus();
67
+ };
68
+
69
+ browserFrame.onerror = () => {
70
+ browserFrame.classList.remove('loading');
71
+ browserFrame.srcdoc = `
72
+ <html><body style="color:white;padding:2rem;background:#0F0F0F;">
73
+ <h1 style="color:#FF0000;">Failed to load page</h1>
74
+ <p>Could not load ${url}</p>
75
+ <p>Try enabling proxy/VPN or check your connection</p>
76
+ </body></html>
77
+ `;
78
+ updateStatus();
79
+ };
80
+ } catch (error) {
81
+ browserFrame.classList.remove('loading');
82
+ browserFrame.srcdoc = `
83
+ <html><body style="color:white;padding:2rem;background:#0F0F0F;">
84
+ <h1 style="color:#FF0000;">Invalid URL</h1>
85
+ <p>${url} is not a valid web address</p>
86
+ <p>Please enter a complete URL like "https://example.com"</p>
87
+ </body></html>
88
+ `;
89
  }
90
+ }
91
+
92
+ // Handle navigation from tabs component
93
+ document.addEventListener('navigate', (e) => {
94
+ const { url, useProxy } = e.detail;
95
+ loadUrl(url, useProxy);
96
+ });
97
+
98
+ // Handle toggle VPN
99
+ document.addEventListener('click', (e) => {
100
  if (e.target.closest('#toggle-vpn')) {
101
+ vpnEnabled = !vpnEnabled;
102
+ updateStatus();
 
 
 
 
103
  }
104
+ });
105
+
106
+ // Handle clear data
107
+ document.addEventListener('click', (e) => {
108
+ if (e.target.closest('#clear-data')) {
109
+ if (confirm('Clear all browsing data (cookies, cache, etc.)?')) {
110
+ browserFrame.src = 'about:blank';
111
+ setTimeout(() => {
112
+ loadUrl('https://www.google.com');
113
+ }, 500);
114
+ }
115
+ }
116
+ });
117
+
118
+ // Initialize
119
+ loadUrl('https://www.google.com');
120
+ updateStatus();
121
+ feather.replace();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  });