-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-> Added logs for PATH / CACHE -> Browser has its own files in appdata -> App can only run once -> Soon (Injections)
- Loading branch information
Showing
6 changed files
with
43 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
using System; | ||
using CefSharp.WinForms; | ||
using CefSharp; | ||
using System; | ||
using System.Windows.Forms; | ||
using System.IO; | ||
|
||
namespace PhpMyAdmin | ||
{ | ||
public partial class FrmMain : Form | ||
{ | ||
private ChromiumWebBrowser chromiumWebBrowser1; | ||
public FrmMain() | ||
{ | ||
InitializeComponent(); | ||
} | ||
InitializeChromium(); | ||
|
||
private void Form1_Load(object sender, EventArgs e) | ||
{ | ||
this.chromiumWebBrowser1.LoadUrl("https://pma.mythicalsystems.xyz"); | ||
} | ||
|
||
private void lblclose_Click(object sender, EventArgs e) | ||
{ | ||
Application.Exit(); | ||
} | ||
|
||
private void lblminimize_Click(object sender, EventArgs e) | ||
private void InitializeChromium() | ||
{ | ||
this.WindowState = FormWindowState.Minimized; | ||
var settings = new CefSettings(); | ||
settings.UserAgent = "PhpMyAdmin Desktop"; | ||
settings.IgnoreCertificateErrors = true; | ||
settings.CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "PhpMyAdmin Desktop"); | ||
settings.RootCachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "PhpMyAdmin Desktop"); | ||
Console.WriteLine("Cache PATH: " + settings.CachePath); | ||
Console.WriteLine("Root PATH: " + settings.RootCachePath); | ||
Console.WriteLine("Browser PATH: " + settings.BrowserSubprocessPath); | ||
Cef.Initialize(settings); | ||
chromiumWebBrowser1 = new ChromiumWebBrowser("https://pma.mythicalsystems.xyz"); | ||
this.Controls.Add(chromiumWebBrowser1); | ||
chromiumWebBrowser1.Dock = DockStyle.Fill; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace PhpMyAdmin | ||
{ | ||
internal static class Program | ||
{ | ||
|
||
/// <summary> | ||
/// The main entry point for the application. | ||
/// </summary> | ||
[STAThread] | ||
static void Main() | ||
{ | ||
Application.EnableVisualStyles(); | ||
Application.SetCompatibleTextRenderingDefault(false); | ||
Application.Run(new FrmMain()); | ||
bool createdNew; | ||
using (Mutex mutex = new Mutex(true, "PhpMyAdmin Desktop", out createdNew)) | ||
{ | ||
if (!createdNew) | ||
{ | ||
// An instance is already running | ||
MessageBox.Show("The application is already running.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); | ||
return; // Exit the application | ||
} | ||
|
||
// Run the application if this is the first instance | ||
Application.EnableVisualStyles(); | ||
Application.SetCompatibleTextRenderingDefault(false); | ||
Application.Run(new FrmMain()); | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alert("Test"); |