Compare commits

...

19 commits

Author SHA1 Message Date
55a4b89b24 fix cam btn 2024-11-25 14:40:26 -06:00
fc736da1d3 fix window size to accomidate new button 2024-11-25 14:32:43 -06:00
1c1f7934fb fix styling on sneedium camBtn 2024-11-25 14:29:55 -06:00
4bac2b0542 add webcam button 2024-11-25 14:26:46 -06:00
bad5e26a86 re-introduce yt/google redirect 2024-11-25 14:21:10 -06:00
42de741e08 since i added adblock/trackblock support this isnt really needed 2024-11-25 14:18:15 -06:00
7198b136a6 add mic/cam access 2024-11-25 14:07:39 -06:00
8d18437dfa add more adblocking, update itworks html 2024-11-25 14:02:23 -06:00
37e109f739 "patches, and patches for the patches" 2024-11-21 15:12:04 -06:00
dc9f6a45a6 Remove userscript support. 2024-11-21 15:04:35 -06:00
995962a497 finish up the rewrite 2024-11-21 14:57:11 -06:00
fbdeb5dc7b no one's sure what devops really means 2024-11-21 14:08:59 -06:00
5789eb88a2 screaming out feibely, disgusting. 2024-11-21 14:02:51 -06:00
5dada52da5 begin work on big rewrite 2024-11-21 13:55:06 -06:00
d16aa9b3f3 Update LICENSE 2024-11-14 19:58:45 +00:00
The Ghost of FOSS' Future
c0037f256e
remove irelivant msg 2024-09-10 20:55:03 -05:00
The Ghost of FOSS' Future
6531460cd0
ok thats cool 2024-09-10 20:54:30 -05:00
The Ghost of FOSS' Future
95219d7298
demote mac maker to a shortcut 2024-09-08 16:13:04 -05:00
The Ghost of FOSS' Future
c7159725e2
Add files via upload 2024-09-08 16:00:22 -05:00
13 changed files with 606 additions and 422 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View file

@ -1,6 +1,6 @@
The Sammy Public License Revision 5 Sub-Revision 1 (SPL-R5 SR1) The Sammy Public License Revision 5 Sub-Revision 2 (SPL-R5 SR2)
Copyright (c) 2024 Sneed Group Copyright (c) Sneed Group
This document grants permission, without charge, to any individual acquiring a copy of the software and its associated documentation files (hereinafter referred to as the "Software"). Such individuals are authorized to engage in activities related to the Software with certain restrictions (listed below), including, but not limited to, the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software. These permissions extend to persons to whom the Software is furnished, subject to compliance with the specified conditions outlined below. This document grants permission, without charge, to any individual acquiring a copy of the software and its associated documentation files (hereinafter referred to as the "Software"). Such individuals are authorized to engage in activities related to the Software with certain restrictions (listed below), including, but not limited to, the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software. These permissions extend to persons to whom the Software is furnished, subject to compliance with the specified conditions outlined below.
@ -10,10 +10,20 @@ In making contributions to the Software, contributors irrevocably assign, transf
Furthermore, this document permits the reuse and redistribution of both executable binaries and source code, contingent upon the inclusion of the previously mentioned copyright notice and permission notice in all copies or substantial portions of the Software. It is imperative that you explicitly acknowledge and agree that the owner(s) retain ownership rights over the aforementioned source code. Furthermore, this document permits the reuse and redistribution of both executable binaries and source code, contingent upon the inclusion of the previously mentioned copyright notice and permission notice in all copies or substantial portions of the Software. It is imperative that you explicitly acknowledge and agree that the owner(s) retain ownership rights over the aforementioned source code.
Moreover, companies using the Software are encouraged to contribute upstream. Fortune 500 companies are required to make an annual contribution of at least 20,000 USD or an equivalent amount per project used to support the said projects' sustainability unless no donation option is provided. Also, all Fortune 500 companies using said projects are required to contibute their changes upstream as well. Additionally, note that the use of AI-assisted tools, including but not limited to GitHub Copilot and ChatGPT, is expressly permitted in conjunction with this software. Users are encouraged to leverage these AI tools to enhance their experience in developing, modifying, and interacting with the Software. The permission granted herein extends to the integration and utilization of AI-generated content for coding and communication purposes. The owner(s) of the Software acknowledge and embrace the collaborative nature of AI-assisted development.
Additionally, note that the use of AI-assisted tools, including but not limited to GitHub Copilot and ChatGPT, is expressly permitted in conjunction with this software. Users are encouraged to leverage these AI tools to enhance their experience in developing, modifying, and interacting with the Software. The permission granted herein extends to the integration and utilization of AI-generated content for coding and communication purposes. The owners(s) of the Software acknowledge and embrace the collaborative nature of AI-assisted development. In addition, the owner of the code is granted the authority to update their copy of The Sammy Public License (SPL) to the latest revision. This update may be undertaken at the discretion of the owner to ensure alignment with any subsequent revisions made to The Sammy Public License.
In addition, the owner of the code is granted the authority to update their copy of The Samuel Public License (SPL) to the latest revision. This update may be undertaken at the discretion of the owner to ensure alignment with any subsequent revisions made to The Samuel Public License. Minimum Payment Requirements by Business Size:
The aforementioned copyright notice and this permission notice must be included in all copies or substantial portions of the Software. 1. Fortune 500 Companies: Companies that are included in the Fortune 500 list are required to make an annual contribution of at least 42,069 USD or an equivalent amount per project used to support the sustainability of the Software, unless no donation option is provided. Additionally, Fortune 500 companies are required to contribute their changes upstream to the Software.
2. Large Non-Fortune 500 Companies: Non-Fortune 500 large companies (defined as companies with 128 or more employees) must pay a minimum of 15,000 USD per year for the continued use of the Software.
3. Medium Businesses: Medium businesses (defined as companies with 42 to 128 employees) are required to pay a minimum of 420 USD per year for the continued use of the Software.
4. Small Businesses: Small businesses (defined as companies with 42 or fewer employees) are required to pay a minimum of 69 USD per year for the continued use of the Software.
These fees are intended to ensure the sustainability of the project and may be subject to change by the project owner(s). Payment is due annually, and the corresponding amount must be paid no later than 30 days after the beginning of each calendar year. Failure to comply with these payment terms may result in revocation of the right to use the Software.
The aforementioned copyright notice and this permission notice must be included in all copies or substantial portions of the Software.

View file

@ -16,6 +16,7 @@
<button onclick="stop(); return false;" id="stopBtn">🛑</button> <button onclick="stop(); return false;" id="stopBtn">🛑</button>
<button onclick="back(); return false;" id="backBtn">⬅️</button> <button onclick="back(); return false;" id="backBtn">⬅️</button>
<button onclick="forward(); return false;" id="forwardBtn">➡️</button> <button onclick="forward(); return false;" id="forwardBtn">➡️</button>
<button id="camBtn">🎦</button>
</div> </div>
<div id="whProtection"> <div id="whProtection">
<tab-group new-tab-button="true" sortable="true"> <tab-group new-tab-button="true" sortable="true">
@ -23,7 +24,6 @@
</tab-group> </tab-group>
</div> </div>
<script src="node_modules/electron-tabs/dist/electron-tabs.js"></script> <script src="node_modules/electron-tabs/dist/electron-tabs.js"></script>
<script type="text/javascript" src="./userscript/userscripts.js"></script>
<script type="text/javascript" src="./config.js"></script> <script type="text/javascript" src="./config.js"></script>
<script type="text/javascript" src="./libbrowz.js"></script> <script type="text/javascript" src="./libbrowz.js"></script>
</body> </body>

View file

@ -1,3 +1,5 @@
<!-- This is the Sneedium new tab page. -->
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
@ -11,6 +13,7 @@
<img src="logo.png" align="right" width="20%"/> <img src="logo.png" align="right" width="20%"/>
<h1>Welcome to Sneedium!</h1> <h1>Welcome to Sneedium!</h1>
<p>Put a list of URLs to userscripts in ./userscript/userscripts.js. It uses a standard JS array format and uses URLs. Config is located at: ./config.js.</p> <p>Welcome to the Sneedium Browser! You can easily compile for for macOS, Windows, and Linux as of the time of writing this. We hope you enjoy this browser as much as we did making it.</br></br>From all of us at Sneed Group.
</p>
</body> </body>
</html> </html>

View file

@ -6,9 +6,7 @@ const userAgents = [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Edg/98.0.0.0", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Edg/98.0.0.0",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0"
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Firefox/128.0"
]; ];
function getRandomUserAgent() { function getRandomUserAgent() {
@ -60,7 +58,7 @@ function go() {
url = searchPattern.replaceAll("!!!QUERY!!!", query) url = searchPattern.replaceAll("!!!QUERY!!!", query)
} else if (url.includes("https://news.google.com")) { } else if (url.includes("https://news.google.com")) {
url = url.replaceAll("https://news.google.com", "http://68k.news") url = url.replaceAll("https://news.google.com", "http://68k.news")
} else if (url.includes("google.com") && !url.includes("maps") && !url.includes("news") && !url.includes("webstore") && !url.includes("drive") && !url.includes("docs") && !url.includes("sheets") && !url.includes("slides") && !url.includes("mail")) { } else if (url.includes("google.com") && !url.includes("maps") && !url.includes("news") && !url.includes("webstore") && !url.includes("drive") && !url.includes("docs") && !url.includes("sheets") && !url.includes("slides") && !url.includes("mail") && !url.includes("webstore") && !url.includes("in") && !url.includes("on") && !url.includes("jp")) {
url = url.replaceAll("google.com", "search.sparksammy.com") url = url.replaceAll("google.com", "search.sparksammy.com")
} }
document.getElementById("txtUrl").value = "" document.getElementById("txtUrl").value = ""
@ -79,11 +77,6 @@ function go() {
tabGroup.getActiveTab().setTitle(title) tabGroup.getActiveTab().setTitle(title)
console.log(title) console.log(title)
}) })
for (let i = 0; i < userscripts.length; i++) {
fetch(userscripts[i]).then( r => r.text() ).then( t => userscripts.executeJavaScript(t)).catch(() => {
console.log("Error loading userscripts! (Did you provide any?)")
})
}
} }
function stop() { function stop() {

78
main.js
View file

@ -1,34 +1,62 @@
// Modules to control application life and create native browser window // Modules to control application life and create native browser window
const {app, BrowserWindow, session, ipcMain} = require('electron') const {app, BrowserWindow, session, ipcMain, systemPreferences} = require('electron')
const path = require('path') const path = require('path')
const fetch = require("cross-fetch") const fetch = require("cross-fetch")
const { ElectronChromeExtensions } = require('electron-chrome-extensions') const { ElectronChromeExtensions } = require('electron-chrome-extensions')
const { ElectronBlocker } = require('@cliqz/adblocker-electron'); const { ElectronBlocker } = require('@ghostery/adblocker-electron');
const http = require('http'); const http = require('http');
const fs = require('fs');
const { createProxy } = require('proxy'); const { createProxy } = require('proxy');
const buildChromeContextMenu = require('electron-chrome-context-menu').default
var extensions
var mic
var cam
app.on('web-contents-created', (event, webContents) => {
webContents.on('context-menu', (e, params) => {
const menu = buildChromeContextMenu({
params,
webContents,
openLink: (url, disposition) => {
webContents.loadURL(url)
}
})
menu.popup()
})
})
ipcMain.on('windowmaker', (event, arg) => { ipcMain.on('windowmaker', (event, arg) => {
createWindow(); createWindow();
}) })
ipcMain.on('allowCam', (event, arg) => {
mic = systemPreferences.askForMediaAccess('microphone');
cam = systemPreferences.askForMediaAccess('camera');
})
const proxy = createProxy(http.createServer()); const proxy = createProxy(http.createServer());
proxy.listen(3129) proxy.listen(3129)
//Function to enable AD Blocking and extensions... //Function to enable AD Blocking...
let blocker = undefined let blocker = undefined
let extensions = undefined
async function enableGoodies(s) { async function enableGoodies(s) {
blocker = await ElectronBlocker.fromLists(fetch, [ blocker = await ElectronBlocker.fromLists(fetch, [
"https://github.com/uBlockOrigin/uAssets/raw/refs/heads/master/filters/ubol-filters.txt",
'https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easylist.txt',
'https://secure.fanboy.co.nz/fanboy-annoyance.txt', 'https://secure.fanboy.co.nz/fanboy-annoyance.txt',
'https://easylist.to/easylist/easyprivacy.txt', 'https://easylist.to/easylist/easyprivacy.txt',
'https://easylist-downloads.adblockplus.org/antiadblockfilters.txt', 'https://easylist-downloads.adblockplus.org/antiadblockfilters.txt',
'https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/nocoin.txt', 'https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/nocoin.txt',
'https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/pro.plus.txt' 'https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/pro.plus.txt',
"https://github.com/yokoffing/filterlists/raw/refs/heads/main/youtube_clear_view.txt",
"https://pgl.yoyo.org/as/serverlist.php?showintro=0;hostformat=adblock",
"https://github.com/uBlockOrigin/uAssets/raw/refs/heads/master/filters/unbreak.txt",
"https://github.com/uBlockOrigin/uAssets/raw/refs/heads/master/filters/quick-fixes.txt",
"https://github.com/uBlockOrigin/uAssets/raw/refs/heads/master/filters/privacy.txt",
"https://github.com/uBlockOrigin/uAssets/raw/refs/heads/master/filters/badware.txt",
"https://github.com/uBlockOrigin/uAssets/raw/refs/heads/master/filters/filters.txt"
]) ])
blocker.enableBlockingInSession(s); blocker.enableBlockingInSession(s);
extensions = new ElectronChromeExtensions({
session: s
})
} }
// 0.0.0.0 day fix // 0.0.0.0 day fix
@ -41,24 +69,43 @@ function isLocal(url) {
return locals.some(local => url.includes(local)); return locals.some(local => url.includes(local));
} }
function createWindow () { function createWindow () {
try {
extensions = new ElectronChromeExtensions()
} catch {
console.log("Creating a new window in the same extension session...")
}
const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({
width: 1100, width: 1220,
height: 600, height: 600,
minWidth: 1100, minWidth: 1220,
minHeight: 600, minHeight: 600,
webPreferences: { webPreferences: {
preload: path.join(__dirname, 'preload.js'), preload: path.join(__dirname, 'preload.js'),
webviewTag: true, webviewTag: true,
devTools: false, devTools: false,
nodeIntegration: true, nodeIntegration: false,
sandbox: true, sandbox: true,
contextIsolation: true contextIsolation: true
} }
}) })
mainWindow.removeMenu() const homePath = app.getPath('home');
const extensionsDir = path.join(homePath, 'SneedExtensions');
if (!fs.existsSync(extensionsDir)) {
fs.mkdirSync(extensionsDir, { recursive: true });
}
const extensionFolders = fs.readdirSync(extensionsDir, { withFileTypes: true })
.filter(dirent => dirent.isDirectory())
.map(dirent => path.join(extensionsDir, dirent.name));
for (const extensionPath of extensionFolders) {
extensions.loadExtension(extensionPath);
}
extensions.addTab(mainWindow.webContents, mainWindow)
mainWindow.setMinimumSize(1000, 300) mainWindow.setMinimumSize(1000, 300)
@ -181,13 +228,14 @@ app.whenReady().then(() => {
// for applications and their menu bar to stay active until the user quits // for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q. // explicitly with Cmd + Q.
app.on('window-all-closed', function () { app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit() if (process.platform !== 'darwin') { app.quit() }
}) })
// In this file you can include the rest of your app's specific main process // In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here. // code. You can also put them in separate files and require them here.
// Set DNS // Set DNS and enable mic/cam
app.on('ready', () => { app.on('ready', () => {
app.configureHostResolver({ app.configureHostResolver({
mode: 'secure', mode: 'secure',

847
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -31,8 +31,10 @@
"electron-packager": "^17.1.2" "electron-packager": "^17.1.2"
}, },
"dependencies": { "dependencies": {
"@cliqz/adblocker-electron": "^1.31.3", "@ghostery/adblocker": "^2.1.1",
"@ghostery/adblocker-electron": "^2.1.1",
"cross-fetch": "^3.1.5", "cross-fetch": "^3.1.5",
"electron-chrome-context-menu": "^1.1.0",
"electron-chrome-extensions": "^3.10.0", "electron-chrome-extensions": "^3.10.0",
"electron-squirrel-startup": "^1.0.1", "electron-squirrel-startup": "^1.0.1",
"electron-tabs": "^1.0.1", "electron-tabs": "^1.0.1",

View file

@ -24,11 +24,20 @@ window.addEventListener('DOMContentLoaded', () => {
} }
ipcRenderer.on('windowmaker', (event, arg) => { ipcRenderer.on('windowmaker', (event, arg) => {
console.log(arg) // prints "pong" console.log(arg)
})
ipcRenderer.on('allowCam', (event, arg) => {
console.log(arg)
}) })
//button and its event listener //button and its event listener
const makeWindowButton = document.getElementById('nwBtn'); const makeWindowButton = document.getElementById('nwBtn');
makeWindowButton.addEventListener('click', () => { makeWindowButton.addEventListener('click', () => {
ipcRenderer.send('windowmaker', 'ping') ipcRenderer.send('windowmaker', 'ping')
}) })
const camButton = document.getElementById('camBtn');
camButton.addEventListener('click', () => {
ipcRenderer.send('allowCam', 'ping')
})
}) })

View file

@ -5,3 +5,5 @@
* `contextIsolation` is turned on. Use the contextBridge API in `preload.js` * `contextIsolation` is turned on. Use the contextBridge API in `preload.js`
* to expose Node.js functionality from the main process. * to expose Node.js functionality from the main process.
*/ */
require('electron-chrome-extension/preload');

View file

@ -1,13 +1 @@
y=$(date +%y) npm run make-mac
read -p "Sneedium4Mac # of year $y (1,2,3,4...):" v
npm run make-mac
mkdir "Sneedium $y.$v"
cp -r sneedium-darwin-arm64 "Sneedium4Mac $y.$v"
cp -r sneedium-darwin-x64 "Sneedium4Mac $y.$v"
rm -rf "sneedium-darwin-arm64"
rm -rf "Ssneedium-darwin-x64"
tar -czvf "Sneedium4Mac $y.$v.tar.gz" "Sneedium4Mac $y.$v"
rm -rf "Sneedium4Mac $y.$v"
mkdir ~/sneedium-mac-bins
cp "Sneedium4Mac $y.$v.tar.gz" "~/sneedium-mac-bins"
rm "Sneedium4Mac $y.$v.tar.gz"

View file

@ -33,6 +33,17 @@ body {
font-size: 1.25rem; font-size: 1.25rem;
} }
#camBtn {
background-color: #a6b70d; /* Gold */
border: none;
color: white;
padding: 1% 1%;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1.25rem;
}
#goBtn { #goBtn {
background-color: #4CAF50; /* Green */ background-color: #4CAF50; /* Green */
border: none; border: none;
@ -106,20 +117,24 @@ html, body {
align-items: center; /* Center vertically */ align-items: center; /* Center vertically */
} }
html, body {
height: 100%;
margin: 0;
}
#whProtection { #whProtection {
position: absolute; width: 100%; /* % of viewport width */
top: 50%; height: 100%; /* % of viewport height */
left: 50%; border: 2vw solid rgb(70, 70, 70); /* Border color and thickness */
bottom: 5%;
transform: translate(-50%, -46%); /* Offset by half the width and 46% height */
width: 90%; /* % of viewport width */
height: 86%; /* % of viewport height */
border: 1vw solid green; /* Border color and thickness */
box-sizing: border-box; box-sizing: border-box;
display: block;
overflow: scroll;
} }
webview { webview {
width: 100%; width: 100%;
height: 100%; height: 100%;
border: none; border: none;
box-sizing: border-box; /* Ensures any padding or border inside the webview is included in the total size */
display: block; /* Ensure it behaves as a block element */
} }

View file

@ -1 +0,0 @@
var userscripts = [""]