Skip to content

Commit

Permalink
Updated - No node modules
Browse files Browse the repository at this point in the history
  • Loading branch information
radubirsan committed Dec 16, 2021
1 parent c90fbb0 commit fb0dec5
Show file tree
Hide file tree
Showing 62 changed files with 10,201 additions and 3,390 deletions.
Binary file added .DS_Store
Binary file not shown.
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

82 changes: 82 additions & 0 deletions browser.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="themes/chrome-like.css">
</head>
<!-- <div id="flash-tabs" style="display: inline;">
<embed id="FlashTab1" src="https://flash.pm/games/F.php?swf=files/adventure,%20escape,%20fighter/Achilles.swf" style='display: none;' width="320" height="200"></embed>
<embed id="FlashTab2" src="https://flash.pm/games/F.php?swf=files/adventure,%20escape,%20fighter/Alias-3.swf" style='display: none;' width="320" height="200"></embed>
<embed id="FlashTab3" src="https://flash.pm/games/F.php?swf=files/typing/Qwerty-Warriors-2.swf" width="320" style='display: none;' width="320" height="200"></embed>
</div>
-->
<body>
<div id="window-controls">
<div class="button" id="min-button">
<img class="icon" srcset="icons/min-w-10.png 1x, icons/min-w-12.png 1.25x, icons/min-w-15.png 1.5x, icons/min-w-15.png 1.75x, icons/min-w-20.png 2x, icons/min-w-20.png 2.25x, icons/min-w-24.png 2.5x, icons/min-w-30.png 3x, icons/min-w-30.png 3.5x" draggable="false" />
</div>
<div class="button" id="max-button">
<img class="icon" srcset="icons/max-w-10.png 1x, icons/max-w-12.png 1.25x, icons/max-w-15.png 1.5x, icons/max-w-15.png 1.75x, icons/max-w-20.png 2x, icons/max-w-20.png 2.25x, icons/max-w-24.png 2.5x, icons/max-w-30.png 3x, icons/max-w-30.png 3.5x" draggable="false" />
</div>
<div class="button" id="restore-button">
<img class="icon" srcset="icons/restore-w-10.png 1x, icons/restore-w-12.png 1.25x, icons/restore-w-15.png 1.5x, icons/restore-w-15.png 1.75x, icons/restore-w-20.png 2x, icons/restore-w-20.png 2.25x, icons/restore-w-24.png 2.5x, icons/restore-w-30.png 3x, icons/restore-w-30.png 3.5x" draggable="false" />
</div>
<div class="button" id="close-button">
<img class="icon" srcset="icons/close-w-10.png 1x, icons/close-w-12.png 1.25x, icons/close-w-15.png 1.5x, icons/close-w-15.png 1.75x, icons/close-w-20.png 2x, icons/close-w-20.png 2.25x, icons/close-w-24.png 2.5x, icons/close-w-30.png 3x, icons/close-w-30.png 3.5x" draggable="false" />
</div>
</div>
<div id="nav-body-tabs"></div>
<div id="nav-body-ctrls"></div>
<div id="nav-body-views"></div>

<script>

const Store = require('./store.js');
const store = new Store({
configName: 'user-preferences'
});

let home = store.get('homepage');

const enav = new (require('electron-navigation'))({
defaultFavicons: true,
newTabCallback: (url, options) => {
options.postTabOpenCallback = webview => {
webview.setAttribute('plugins', '');
}
return {options};
}
});
const {clipboard} = require('electron');
//clipboard.writeText('Example String');
let clipboardStr = clipboard.readText();
var length = window.process.argv.length;
var lastArgument = window.process.argv[length-1]
if(lastArgument && lastArgument.indexOf("file:///") == 0) {
console.log(lastArgument);
//lastArgument = 'file:///D:/FlashPM/FlashBrowser-master/AS3.html';
//lastArgument = 'file:///D:/FlashPM/FlashBrowser-master/noimage.swf';
//var path2 = lastArgument.replace(/\\/g, "/");
//path2 = 'file:///' + path2;
// open a local file, and use a custom icon
enav.newTab(lastArgument, {
title: 'Local file'
})
}
else if(clipboardStr.indexOf("https://") == 0) {
enav.newTab(clipboardStr);
mainWindow.show();
}
else if(home){
console.log("WE HAGE CUSTOM HOMEPAGE" + home);
enav.newTab(home, {icon: "icons/restore-w-24.png"})}
else{
enav.newTab('https://search.flash.pm/', {icon: "clear"});
}





</script>
</body>
</html>
Binary file added flashver/.DS_Store
Binary file not shown.
Binary file removed flashver/libpepflashplayer.so
Binary file not shown.
Binary file removed flashver/pepflashplayer32.dll
Binary file not shown.
Binary file removed flashver/pepflashplayer64.dll
Binary file not shown.
Binary file added icon.icns
Binary file not shown.
Binary file added icons/close-k-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-k-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-k-15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-k-20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-k-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-k-30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-w-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-w-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-w-15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-w-20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-w-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/close-w-30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-k-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-k-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-k-15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-k-20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-k-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-k-30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-w-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-w-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-w-15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-w-20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-w-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/max-w-30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/min-k-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/min-k-12.png
Binary file added icons/min-k-15.png
Binary file added icons/min-k-20.png
Binary file added icons/min-k-24.png
Binary file added icons/min-k-30.png
Binary file added icons/min-w-10.png
Binary file added icons/min-w-12.png
Binary file added icons/min-w-15.png
Binary file added icons/min-w-20.png
Binary file added icons/min-w-24.png
Binary file added icons/min-w-30.png
Binary file added icons/restore-k-10.png
Binary file added icons/restore-k-12.png
Binary file added icons/restore-k-15.png
Binary file added icons/restore-k-20.png
Binary file added icons/restore-k-24.png
Binary file added icons/restore-k-30.png
Binary file added icons/restore-w-10.png
Binary file added icons/restore-w-12.png
Binary file added icons/restore-w-15.png
Binary file added icons/restore-w-20.png
Binary file added icons/restore-w-24.png
Binary file added icons/restore-w-30.png
288 changes: 288 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
const {
app,
protocol,
BrowserWindow,
globalShortcut,
Menu
} = require('electron');
const {autoUpdater} = require("electron-updater");

const path = require('path');
const Store = require('./store.js');
const contextMenu = require('electron-context-menu');

contextMenu({
showSaveImageAs: true
});

let mainWindow;

let pluginName = null; //put the right flash plugin in depending on the operating system.
switch (process.platform) {
case 'win32':
switch (process.arch) {
case 'ia32':
case 'x32':
pluginName = 'flashver/pepflashplayer32.dll'
console.log("ran!");
break
case 'x64':
pluginName = 'flashver/pepflashplayer64.dll'
console.log("ran!");
break
}
break
case 'linux':
switch (process.arch) {
case 'ia32':
case 'x32':
pluginName = 'flashver/libpepflashplayer.so' // added and tested :D
break
case 'x64':
pluginName = 'flashver/libpepflashplayer.so'
break
}

app.commandLine.appendSwitch('no-sandbox');
break
case 'darwin':
pluginName = 'flashver/PepperFlashPlayer.plugin'
break
}
app.commandLine.appendSwitch("disable-renderer-backgrounding");
if (process.platform !== "darwin") {
app.commandLine.appendSwitch('high-dpi-support', "1");
//app.commandLine.appendSwitch('force-device-scale-factor', "1");
}
app.commandLine.appendSwitch("--enable-npapi");
app.commandLine.appendSwitch('ppapi-flash-path', path.join(__dirname, pluginName));
//app.commandLine.appendSwitch('ppapi-flash-path', path.join(__dirname.includes(".asar") ? process.resourcesPath : __dirname, "plugins/" + pluginName));
app.commandLine.appendSwitch('disable-site-isolation-trials');
app.commandLine.appendSwitch('no-sandbox');
app.commandLine.appendSwitch('ignore-certificate-errors', 'true');
app.commandLine.appendSwitch('allow-insecure-localhost', 'true');

let sendWindow = (identifier, message) => {
mainWindow.webContents.send(identifier, message);
};

const store = new Store({
configName: 'user-preferences',
defaults: {
windowBounds: { width: 1280, height: 720, max:false }
}
});

const template = [];

const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);

app.on('ready', () => {

let { width, height, isMax } = store.get('windowBounds');
let filePath = 'filePath';
console.log("inti param" + process.argv);
if(process.argv.length >= 2 && process.argv[1].indexOf(".swf") > 1) {

filePath = process.argv[1];
filePath = filePath.replace(/\\/g, "/");
filePath = 'file:///' + filePath;
//open, read, handle file
}
if(width < 100 || height < 100) {
width = 800;
height = 500;
}



mainWindow = new BrowserWindow({
width: width,
height: height,
frame: false,
show:true,
backgroundColor: '#202124',
webPreferences: {
nodeIntegration: true,
webviewTag: true,
plugins: true,
contextIsolation: false,
enableRemoteModule: true,
additionalArguments: [filePath]
}
});




mainWindow.loadURL(`file://${__dirname}/browser.html`);


// Modify the user agent for all requests to the following urls.
const filter = {
urls: ['https://*.darkorbit.com/*', 'https://*.whatsapp.com/*']
}
mainWindow.webContents.session.webRequest.onBeforeSendHeaders(filter,(details, callback) => {

details.requestHeaders['X-APP'] = app.getVersion();
details.requestHeaders['User-Agent'] = 'BigpointClient/1.4.6';
if(details.url.indexOf("whatsapp") > 0) {
details.requestHeaders['User-Agent'] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15";
}
callback({ requestHeaders: details.requestHeaders })
});

sendWindow("version", app.getVersion());

mainWindow.on('closed', () => {
mainWindow = null;
});




mainWindow.once('ready-to-show', () => {
if(isMax) {
if(process.platform === "win32"){
mainWindow.maximize();

}
else{
mainWindow.setFullScreen(true)
}


}
mainWindow.show()
})


// Upper Limit is working of 500 %
mainWindow.webContents.setVisualZoomLevelLimits(1, 5).then(console.log("Zoom Levels Have been Set between 100% and 500%")).catch((err) => console.log(err));


mainWindow.on('resize', () => {
var isMax = mainWindow.isMaximized() || mainWindow.isFullScreen()

if(isMax) {
console.log( isMax);
let { width, height, max } = store.get('windowBounds');
store.set('windowBounds', { width, height , isMax});
}
else{
let { width, height } = mainWindow.getBounds();
store.set('windowBounds', { width, height , isMax});
}

});
globalShortcut.register("CTRL+SHIFT+I", () => {
mainWindow.webContents.openDevTools();
});

globalShortcut.register("CmdOrCtrl+=", () => {
console.log("CmdOrCtrl+");
mainWindow.webContents.zoomFactor = mainWindow.webContents.getZoomFactor() + 0.2;
});
globalShortcut.register("CmdOrCtrl+-", () => {
mainWindow.webContents.zoomFactor = mainWindow.webContents.getZoomFactor() - 0.2;
});

globalShortcut.register("CTRL+SHIFT+F10", () => {
let session = mainWindow.webContents.session;
session.clearCache();
app.relaunch();
app.exit();
});

mainWindow.webContents.zoomFactor = 1;
console.log("checkForUpdatesAndNotify");
autoUpdater.checkForUpdatesAndNotify();




var {ElectronBlocker} = require('@cliqz/adblocker-electron');
var {fetch} = require('cross-fetch');

ElectronBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker)=>{
blocker.enableBlockingInSession(session.defaultSession);
});


});

app.on('open-file', (event, path) =>
{
event.preventDefault();
console.log(path);
});
exports.test = () => clearCache();
function clearCache() {

let session = mainWindow.webContents.session;
session.clearCache();
app.relaunch();
app.exit();

};

exports.sethome = (a) => homeSetter(a);

function homeSetter(a){
store.set('homepage', a );
console.log("Favorite url:" + a);
};

exports.setFavorite = (a) => favoriteSetter(a);

function favoriteSetter(a){
let fav = store.get('favorites');
if(fav && fav.indexOf(a) ) {
fav.push(a);
}
else{
fav = [a]
}
store.set('favorites', fav);
console.log("S url:" + fav);
};




app.on('window-all-closed', () => {
//if (process.platform !== 'darwin') {
app.quit();
//}
});

autoUpdater.on('checking-for-update', () => {
sendWindow('checking-for-update', '');
});

autoUpdater.on('update-available', () => {
sendWindow('update-available', '');
});

autoUpdater.on('update-not-available', () => {
sendWindow('update-not-available', '');
});

autoUpdater.on('error', (err) => {
sendWindow('error', 'Error: ' + err);
});

autoUpdater.on('download-progress', (d) => {
sendWindow('download-progress', {
speed: d.bytesPerSecond,
percent: d.percent,
transferred: d.transferred,
total: d.total
});
});

autoUpdater.on('update-downloaded', () => {
sendWindow('update-downloaded', 'Update downloaded');
autoUpdater.quitAndInstall();
});
Loading

0 comments on commit fb0dec5

Please sign in to comment.