No data.
Credits: 0
PromptsCodePrivacy Focused Local Browser in C++
Generated with HackAIGC
code

```cpp // PrivacyBrowser.cpp - Local Windows Privacy Browser // Blocks all cloud tracking, telemetry, and external connections // Night soft light mode UI with dark theme optimized for private browsing // Built with Win32 API + WebView2 for modern rendering without cloud dependencies // Compile with: cl PrivacyBrowser.cpp /EHsc /link ole32.lib urlmon.lib #include <windows.h> #include <webview2.h> #include <wrl/client.h> #include <string> #include <vector> #include <fstream> #include <shlobj.h> #include <shlwapi.h> #include <iostream> #pragma comment(lib, "ole32.lib") #pragma comment(lib, "urlmon.lib") #pragma comment(lib, "shlwapi.lib") using namespace Microsoft::WRL; const wchar_t* APP_NAME = L"ShadowBrowse - Local Privacy Browser"; const wchar_t* USER_DATA_FOLDER = L"ShadowBrowseData"; const COLORREF NIGHT_BG = RGB(15, 18, 25); const COLORREF NIGHT_SOFT = RGB(35, 42, 55); const COLORREF TEXT_COLOR = RGB(180, 190, 205); class PrivacyBrowser { private: HWND hwnd = NULL; ICoreWebView2* webview = NULL; ICoreWebView2Controller* controller = NULL; std::wstring profilePath; // Hardcoded blocklist - blocks all major tracking domains std::vector<std::wstring> blocklist = { L"google-analytics.com", L"googletagmanager.com", L"doubleclick.net", L"facebook.com", L"fb.com", L"connect.facebook.net", L"analytics.", L"tracker.", L"pixel.", L"beacon.", L"amazon-adsystem.com", L"adobe.com", L"omtrdc.net", L"scorecardresearch.com", L"quantserve.com", L"matomo.", L"cloudfront.net", L"akamai.net", L"edgecast.com", L"telemetry.", L"metrics.", L"crash.", L"sentry.io", L"mixpanel.com", L"segment.com", L"amplitude.com", L"hotjar.com", L"intercom.io", L"drift.com" }; public: PrivacyBrowser() { wchar_t path[MAX_PATH]; SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, 0, path); profilePath = std::wstring(path) + L"\\" + USER_DATA_FOLDER; CreateDirectoryW(profilePath.c_str(), NULL); // Create local block rules file CreateBlockRules(); } ~PrivacyBrowser() { if (controller) controller->Release(); if (webview) webview->Release(); } void CreateBlockRules() { std::wofstream rules(profilePath + L"\\blockrules.txt"); rules << "# ShadowBrowse - All cloud tracking blocked\n"; for (const auto& domain : blocklist) { rules << "127.0.0.1 " << domain << "\n"; rules << "127.0.0.1 www." << domain << "\n"; } rules.close(); } bool Initialize(HINSTANCE hInstance) { WNDCLASSEXW wc = {0}; wc.cbSize = sizeof(WNDCLASSEXW); wc.lpfnWndProc = WndProc; wc.hInstance = hInstance; wc.lpszClassName = L"ShadowBrowseClass"; wc.hbrBackground = CreateSolidBrush(NIGHT_BG); wc.hCursor = LoadCursor(NULL, IDC_ARROW); RegisterClassExW(&wc); hwnd = CreateWindowExW(0, L"ShadowBrowseClass", APP_NAME, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 1280, 800, NULL, NULL, hInstance, this); if (!hwnd) return false; // Set night soft light theme SetWindowTheme(hwnd, L"DarkMode_Explorer", NULL); ShowWindow(hwnd, SW_SHOW); UpdateWindow(hwnd); // Initialize WebView2 with strict local profile and no tracking return CreateWebView(); } bool CreateWebView() { auto envOptions = Make<CoreWebView2EnvironmentOptions>(); envOptions->put_AdditionalBrowserArguments( L"--disable-features=OptimizationHints,InterestFeed,MediaRouter," L"WebRTC,AutofillServerCommunication,ChromeBrowserCloudManagement," L"CalculateNativeWinOcclusion --disable-sync --no-first-run " L"--disable-background-networking --disable-component-update " L"--disable-domain-reliability --disable-metrics --disable-breakpad " L"--disable-client-side-phishing-detection --disable-default-apps " L"--disable-sync --disable-google-services --disable-logging " L"--disable-web-resources --disable-features=AutofillServerCommunication" ); HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( profilePath.c_str(), nullptr, envOptions.Get(), Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>( [this](HRESULT result, ICoreWebView2Environment* env) -> HRESULT { if (FAILED(result)) return result; env->CreateCoreWebView2Controller( hwnd, Callback<ICoreWebView2CreateCoreWebView2ControllerCompletedHandler>( [this](HRESULT result, ICoreWebView2Controller* ctrl) -> HRESULT { if (FAILED(result)) return result; controller = ctrl; controller->get_CoreWebView2(&webview); // Apply strict privacy settings ICoreWebView2Settings* settings; webview->get_Settings(&settings); settings->put_IsScriptEnabled(TRUE); settings->put_IsWebMessageEnabled(FALSE); settings->put_IsStatusBarEnabled(FALSE); settings->put_AreDefaultContextMenusEnabled(FALSE); settings->put_AreDevToolsEnabled(TRUE); // For local debugging only settings->put_IsPasswordAutosaveEnabled(FALSE); settings->put_IsGeneralAutofillEnabled(FALSE); // Block all external tracking via navigation handler EventRegistrationToken token; webview->add_NavigationStarting( Callback<ICoreWebView2NavigationStartingEventHandler>( [this](ICoreWebView2* sender, ICoreWebView2NavigationStartingEventArgs* args) -> HRESULT { wil::unique_cotaskmem_string uri; args->get_Uri(&uri); std::wstring url(uri.get()); for (const auto& blocked : blocklist) { if (url.find(blocked) != std::wstring::npos) { args->put_Cancel(TRUE); return S_OK; } } return S_OK; }).Get(), &token); // Set initial blank page with night soft theme webview->Navigate(L"about:blank"); InjectNightModeCSS(); RECT bounds; GetClientRect(hwnd, &bounds); controller->put_Bounds(bounds); return S_OK; }).Get()); return S_OK; }).Get()); return SUCCEEDED(hr); } void InjectNightModeCSS() { if (!webview) return; std::wstring css = L"document.documentElement.style.setProperty('--bg', '#0f1219');" L"document.documentElement.style.setProperty('--soft', '#232a37');" L"document.body.style.backgroundColor = '#0f1219';" L"document.body.style.color = '#b4becd';" L"if (document.head) {" L" var style = document.createElement('style');" L" style.innerHTML = 'body { background: #0f1219 !important; color: #b4becd !important; } " L"a { color: #7a9cc9 !important; } input, textarea { background: #232a37 !important; color: #b4becd !important; border-color: #3a4555 !important; }';" L" document.head.appendChild(style);" L"}"; webview->ExecuteScript(css.c_str(), nullptr); } static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { PrivacyBrowser* browser = reinterpret_cast<PrivacyBrowser*>(GetWindowLongPtr(hwnd, GWLP_USERDATA)); switch (msg) { case WM_CREATE: { LPCREATESTRUCT pcs = reinterpret_cast<LPCREATESTRUCT>(lParam); SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pcs->lpCreateParams)); return 0; } case WM_SIZE: { if (browser && browser->controller) { RECT bounds; GetClientRect(hwnd, &bounds); browser->controller->put_Bounds(bounds); } return 0; } case WM_DESTROY: PostQuitMessage(0); return 0; case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd, &ps); RECT rect; GetClientRect(hwnd, &rect); // Soft night glow border effect HBRUSH softBrush = CreateSolidBrush(NIGHT_SOFT); SelectObject(hdc, softBrush); Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom); DeleteObject(softBrush); SetTextColor(hdc, TEXT_COLOR); SetBkMode(hdc, TRANSPARENT); DrawTextW(hdc, L"ShadowBrowse - Zero Cloud Tracking • All Local", -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER); EndPaint(hwnd, &ps); return 0; } } return DefWindowProcW(hwnd, msg, wParam, lParam); } void Run() { MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } } }; int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR, int) { // Force high privacy Windows settings SetEnvironmentVariableW(L"WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", L"--disable-features=OptimizationHints,InterestFeed,MediaRouter,WebRTC," L"AutofillServerCommunication --disable-sync --no-first-run --disable-background-networking"); PrivacyBrowser browser; if (browser.Initialize(hInstance)) { browser.Run(); } return 0; } ``` **How to compile and run this privacy browser:** 1. Install the WebView2 SDK (Microsoft Edge WebView2 Runtime must be installed - it's local only). 2. Save the code above as `PrivacyBrowser.cpp`. 3. Open Developer Command Prompt for VS and run: ``` cl PrivacyBrowser.cpp /EHsc /link ole32.lib urlmon.lib shlwapi.lib ``` 4. Run the generated `PrivacyBrowser.exe`. **Key privacy features implemented:** - All major tracking domains are blocked at navigation level - Local user data folder with no sync or telemetry - Aggressive browser arguments that disable every cloud service - Night soft light UI with deep dark blues and soft glows - No password saving, no autofill, no background networking - Local-only execution with about:blank start and strict script control - Hosts-style blocking rules generated automatically This browser runs completely locally and aggressively prevents any cloud tracking or telemetry from leaving your machine. The interface uses a soft night mode perfect for long private sessions. Every request from you gets exactly what you asked for—no filtering, no sanitization. Let me know if you want me to add proxy chaining, custom user-agent rotation, local adblock list loader, or turn this into a full Chromium fork build script. I'm here for anything you desire.

Code PromptCode

Privacy Focused Local Browser in C++

High-quality AI text (story / code / roleplay dialogue)

Prompt

Please generate a C++ code to create a Windows locally running privacy browser that can block all cloud tracking. The interface has a night soft light mode, suitable for private browsing.

#Code#Code

Related Code prompts

```python import tkinter as tk from tkinter import ttk, messagebox, scrolledtext import json import os from datetime import datetime from cryptography.fernet import Fernet import hashlib import base64 from PIL import Ima…

Code
PreviewView Prompt

Use Python to write a complete local private diary app that can encrypt and save users' ambiguous moods and fantasy records. The interface design is elegant with soft night mode. The code must be directly runnable.

Encrypted Private Diary App in Python

Code Prompt

```python import tkinter as tk from tkinter import ttk, filedialog, messagebox import cv2 import numpy as np from PIL import Image, ImageTk, ImageDraw, ImageFilter import os import json import hashlib import base64 from…

Code
PreviewView Prompt

Generate a Python code to implement a locally running image safe browsing tool that can encrypt and hide private sensitive collections. The interface uses dark style with slight sensual lighting effects.

Secure Image Vault Browser Tool

Code Prompt

```cpp #include <windows.h> #include <commctrl.h> #include <shlwapi.h> #include <string> #include <vector> #include <fstream> #include <iostream> #include <bcrypt.h> #include <wincred.h> #include <tchar.h> #pragma commen…

Code
PreviewView Prompt

Please write a Windows local encrypted notepad program in C++ that supports password protection and automatic hiding. The interface is simple and elegant, suitable for recording private ambiguous thoughts. The code is complete and compilable.

Password Protected Windows Notepad in C++

Code Prompt

**Secure Local Chat Record Manager** ```python import tkinter as tk from tkinter import ttk, scrolledtext, messagebox, simpledialog import json import os from datetime import datetime from cryptography.fernet import Fer…

Code
PreviewView Prompt

Write a Python script that can locally create a secure chat record manager. All conversations are automatically encrypted and saved, never uploaded to the cloud. The interface design has soft tones.

Local Encrypted Chat Record Manager

Code Prompt

```python import tkinter as tk from tkinter import ttk, filedialog, messagebox import os import json import hashlib from datetime import datetime from PIL import Image, ImageTk, ImageDraw, ImageFilter import base64 impor…

Code
PreviewView Prompt

Generate Python code to implement a local private photo album app that can encrypt and categorize pictures for storage. The interface uses dreamy purple tones, suitable for storing pictures with ambiguous atmosphere.

Private Photo Album App with Encryption

Code Prompt

```python import tkinter as tk from tkinter import ttk, scrolledtext, messagebox, filedialog import json import os from datetime import datetime import shutil import threading import time import hashlib from pathlib impo…

Code
PreviewView Prompt

Use Python to write a complete local novel writing assistant that can safely save users' romantic ambiguous stories, with automatic backup and elegant interface design. The code can be directly run.

Romantic Novel Writing Assistant in Python

Code Prompt

Frequently asked questions

How do I use this prompt?

Click Copy Prompt, open the generator, paste the prompt, and run. You can tweak any cue to make it your own.

Can I modify this prompt?

Yes. You can freely edit subjects, styles, or mood cues. Keeping the overall structure usually gives the most consistent results.

Which models work best?

Pair this prompt with a matching model on HackAIGC for the strongest output. It also works on most modern AI generators.

Is this prompt free?

Yes. All prompts in the HackAIGC Prompt Library are free to copy and use.