-
Notifications
You must be signed in to change notification settings - Fork 19
Added CheerpJ extension docs (Debug & File handling) #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --- | ||
| title: Debug builds | ||
| description: How to enable debug mode and collect logs for troubleshooting | ||
| --- | ||
|
|
||
| If you encounter issues while running an applet with CheerpJ Applet Runner, enabling **Debug Mode** can provide detailed logs that help our support team identify the problem. | ||
|
|
||
| ## Enabling Debug Mode | ||
|
|
||
| To enable the debug build of CheerpJ: | ||
|
|
||
| 1. Click the **CheerpJ Applet Runner icon** in your browser's toolbar. | ||
| 2. In the popup page, toggle the **"Enable debugging mode"** switch to **On**. | ||
| 3. The extension will now use the debug version of the runtime, which includes extensive logging. | ||
|
|
||
| ## Collecting Debug Information | ||
|
|
||
| To help us troubleshoot, we typically need two files: the **Console log** and a **Network HAR file**. | ||
|
|
||
| ### Step 1: Open Browser DevTools | ||
|
|
||
| You must open the browser's developer tools **before** the applet starts loading, or **reload the page** once they are open. | ||
|
|
||
| 1. Press `F12` (Windows/Linux) or `Cmd + Opt + I` (Mac) to open the DevTools. | ||
| 2. Alternatively, right-click anywhere on the page and select **Inspect**. | ||
|
|
||
| ### Step 2: Save the Browser Console Output | ||
|
|
||
| Follow these instructions to [save the browser console output](https://cheerpj.com/docs/guides/cheerpj-debug#saving-the-browser-console-output). | ||
|
|
||
| ### Step 3: Extract a HAR File | ||
|
|
||
| Follow these instructions to [extract a HAR file](https://cheerpj.com/docs/guides/cheerpj-debug#extracting-a-har-file). | ||
|
|
||
| --- | ||
|
|
||
| Once you have collected these files, please attach them to your support request or bug report. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||
| --- | ||||||
| title: Upload and download files | ||||||
| description: How to interact with the local filesystem using the Applet Runner extension | ||||||
| --- | ||||||
|
|
||||||
| The CheerpJ Applet Runner extension provides a virtual filesystem that allows Java applets to read and write files within the browser's sandbox. Since browsers cannot access your local disk directly for security reasons, CheerpJ provides two main ways to move files into and out of this virtual space. | ||||||
|
|
||||||
| ## Method 1: Using the extension popup | ||||||
|
|
||||||
| The extension popup (accessible by clicking the CheerpJ icon in your browser's toolbar) provides direct controls for file handling once the extension is enabled on a page. | ||||||
|
|
||||||
| ### Uploading files | ||||||
|
|
||||||
| To import a local file to the virtual filesystem: | ||||||
|
|
||||||
| 1. Click the **Upload** button in the extension popup. | ||||||
| 2. Select the file(s) from your local machine. | ||||||
| 3. The files will be automatically placed in the **`/files/uploads/`** directory. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| Inside the Java applet, you can then navigate to `/files/uploads/` to open or import these files. | ||||||
|
|
||||||
| ### Downloading files | ||||||
|
|
||||||
| Any file that the Java applet saves to the **`/files/downloads/`** directory will be automatically detected and downloaded by your browser to your local machine (usually your default Downloads folder). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| To export data, simply ensure the applet's save path is set to `/files/downloads/`. | ||||||
|
|
||||||
| ## Method 2: Using the built-in file picker (JFileChooser) | ||||||
|
|
||||||
| If the Java applet uses a standard `JFileChooser` dialog, CheerpJ provides an integrated way to handle local files without leaving the applet's UI. | ||||||
|
|
||||||
| ### Integrated Upload | ||||||
|
|
||||||
| The `JFileChooser` dialog in CheerpJ features an **upload button** (upward arrow icon) in the top-right corner. | ||||||
|
|
||||||
| 1. Click the **upload button** within the file picker. | ||||||
| 2. Select a file from your local machine. | ||||||
| 3. The file is automatically uploaded to the virtual filesystem at **`/files/uploads/`**. | ||||||
| 4. In the `JFileChooser`, navigate to `/files/uploads/` and select the file to load it into the applet. | ||||||
|
|
||||||
| ### Integrated Download | ||||||
|
|
||||||
| Similarly, if you use a "Save" dialog and choose a path under **`/files/downloads/`**, the browser will automatically trigger a download of the file to your local machine once the save operation is complete. | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --- | ||
| title: Debug builds | ||
| description: How to enable debug mode and collect logs for troubleshooting | ||
| --- | ||
|
|
||
| If you encounter issues while running a Java Web Start application with CheerpJ JNLP Runner, enabling **Debug Mode** can provide detailed logs that help our support team identify the problem. | ||
|
|
||
| ## Enabling Debug Mode | ||
|
|
||
| To enable the debug build of CheerpJ: | ||
|
|
||
| 1. Click the **CheerpJ JNLP Runner icon** in your browser's toolbar. | ||
| 2. In the popup page, toggle the **"Enable debugging mode"** switch to **On**. | ||
| 3. The extension will now use the debug version of the runtime, which includes extensive logging. | ||
|
|
||
| ## Collecting Debug Information | ||
|
|
||
| To help us troubleshoot, we typically need two files: the **Console log** and a **Network HAR file**. | ||
|
|
||
| ### Step 1: Open Browser DevTools | ||
|
|
||
| For the JNLP Runner, you can open the browser's developer tools directly on the **"start app"** page (the intermediate page that appears before the application launches). | ||
|
|
||
| 1. Press `F12` (Windows/Linux) or `Cmd + Opt + I` (Mac) to open the DevTools. | ||
| 2. Alternatively, right-click anywhere on the page and select **Inspect**. | ||
|
|
||
| ### Step 2: Save the Browser Console Output | ||
|
|
||
| Follow these instructions to [save the browser console output](https://cheerpj.com/docs/guides/cheerpj-debug#saving-the-browser-console-output). | ||
|
|
||
| ### Step 3: Extract a HAR File | ||
|
|
||
| Follow these instructions to [extract a HAR file](https://cheerpj.com/docs/guides/cheerpj-debug#extracting-a-har-file). | ||
|
|
||
| --- | ||
|
|
||
| Once you have collected these files, please attach them to your support request or bug report. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||
| --- | ||||||
| title: Upload and download files | ||||||
| description: How to interact with the local filesystem using the JNLP Runner extension | ||||||
| --- | ||||||
|
|
||||||
| The CheerpJ JNLP Runner extension provides a virtual filesystem that allows Java Web Start applications to read and write files within the browser's sandbox. Since browsers cannot access your local disk directly for security reasons, CheerpJ provides two main ways to move files into and out of this virtual space. | ||||||
|
|
||||||
| ## Method 1: Using the extension popup | ||||||
|
|
||||||
| The extension popup (accessible by clicking the CheerpJ icon in your browser's toolbar) provides direct controls for file handling once the extension is enabled on a page. | ||||||
|
|
||||||
| ### Uploading files | ||||||
|
|
||||||
| To import a local file to the virtual filesystem: | ||||||
|
|
||||||
| 1. Click the **Upload** button in the extension popup. | ||||||
| 2. Select the file(s) from your local machine. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 3. The files will be automatically placed in the **`/files/uploads/`** directory. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| Inside the Java application, you can then navigate to `/files/uploads/` to open or import these files. | ||||||
|
|
||||||
| ### Downloading files | ||||||
|
|
||||||
| Any file that the Java application saves to the **`/files/downloads/`** directory will be automatically detected and downloaded by your browser to your local machine (usually your default Downloads folder). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| To export data, simply ensure the applet's save path is set to `/files/downloads/`. | ||||||
|
|
||||||
| ## Method 2: Using the built-in file picker (JFileChooser) | ||||||
|
|
||||||
| If the Java application uses a standard `JFileChooser` dialog, CheerpJ provides an integrated way to handle local files without leaving the application's UI. | ||||||
|
|
||||||
| ### Integrated Upload | ||||||
|
|
||||||
| The `JFileChooser` dialog in CheerpJ features an **upload button** (upward arrow icon) in the top-right corner. | ||||||
|
|
||||||
| 1. Click the **upload button** within the file picker. | ||||||
| 2. Select a file from your local machine. | ||||||
| 3. The file is automatically uploaded to the virtual filesystem at **`/files/uploads/`**. | ||||||
| 4. In the `JFileChooser`, navigate to `/files/uploads/` and select the file to load it into the application. | ||||||
|
|
||||||
| ### Integrated Download | ||||||
|
|
||||||
| Similarly, if you use a "Save" dialog and choose a path under **`/files/downloads/`**, the browser will automatically trigger a download of the file to your local machine once the save operation is complete. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.