-
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
Open
rijulshrestha
wants to merge
11
commits into
main
Choose a base branch
from
CheerpJ-Extension-Docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
85de0f9
Added debug information for Applet and JNLP runner
rijulshrestha 1363ed8
Added file upload/download guide for Applet and JNLP runner
rijulshrestha 1f05121
Updated wording between the local filesystem and the virtual one
rijulshrestha a65eb45
Updated debug and file handling applet pages
rijulshrestha fa6f772
Updated debug and file handling jnlp pages
rijulshrestha 383872a
Added pre debug extension verification content
rijulshrestha c85fe4b
Refine extension file handling guides
rijulshrestha 76df937
Added discord and github issue links
rijulshrestha cd66fb4
Added context and info to applet file handling
rijulshrestha 53145e3
Added screenshots to Applet Runner docs
rijulshrestha e8934bb
Remove JNLP Runner guides for separate PR
rijulshrestha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
sites/labs/src/content/docs/cheerpj-applet-runner/04-guides/debug-builds.mdx
This file contains hidden or 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,48 @@ | ||
| --- | ||
| title: How to debug the extension | ||
| 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. | ||
|
|
||
| > [!important] Reload Required | ||
| > You must enable the debugging mode **before** loading your application, or **reload the page** after enabling it. Otherwise, the setting will not take effect. | ||
|
|
||
| ## 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 | ||
|
|
||
| To ensure we receive complete logs, **you must either reload the page after opening the developer tools, or enable the extension only after the developer tools 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 | ||
|
|
||
| 1. With the developer tools open, navigate to the **Console** tab. (If you don’t see it, click the `+` symbol in Edge or `>>` in Chrome, then select Console). | ||
| 2. If needed, trigger the error in your application. | ||
| 3. Right-click on any message in the console tab and select **Save as…** | ||
| 4. Save the console log to a file. | ||
|
|
||
| ### Step 3: Extract a HAR File | ||
|
|
||
| A HAR (HTTP Archive) file logs your browser's network interactions and helps us diagnose loading or server responses. | ||
|
|
||
| 1. In the developer tools, navigate to the **Network** tab. | ||
| 2. **Reload your page** (or navigate to the applet) to ensure the network log captures requests from the very beginning. | ||
| 3. Trigger the error in your application if needed. | ||
| 4. Click the download icon (`↓`) at the top right of the Network tab to export and save the HAR file. | ||
|
|
||
| --- | ||
|
|
||
| Once you have collected these files, please attach them to your support request or bug report. |
48 changes: 48 additions & 0 deletions
48
sites/labs/src/content/docs/cheerpj-applet-runner/04-guides/file-handling.mdx
This file contains hidden or 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,48 @@ | ||
| --- | ||
| title: Upload and download files | ||
| description: How to interact with the local filesystem using the Applet Runner extension | ||
| --- | ||
|
|
||
| For a deeper dive into how file systems work in CheerpJ, check out the [File System explanation guide](https://cheerpj.com/docs/explanation/File-System-support). | ||
|
|
||
| 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. | ||
|
|
||
| > [!note] Pin the extension | ||
| > If you cannot see the extension popup icon, you may need to pin the extension to your browser's toolbar. | ||
|
|
||
| ### Uploading files | ||
|
|
||
| The upload button is only available in the extension popup **once a Java applet is already running**. 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 filesystem (your machine). | ||
| 3. The files will be automatically placed in the **`/files/uploads/`** virtual directory. | ||
|
|
||
| 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/`** virtual directory will be automatically detected and downloaded by your browser to your local machine (usually your default Downloads folder). | ||
|
|
||
| To export data, simply ensure the applet's save path is set to `/files/downloads/`. | ||
|
|
||
| ## Method 2: Using the built-in file picker | ||
|
|
||
| If the Java applet uses a standard Java File Dialog (for example, `JFileChooser`), CheerpJ provides an integrated way to handle local files without leaving the applet's UI. | ||
|
|
||
| ### Integrated Upload | ||
|
|
||
| The upload icon (an upward arrow) is present as part of the title bar on any window, frame, or File Dialog that opens. | ||
|
|
||
| 1. Click the **upload icon** in the title bar. | ||
| 2. Select a file from your local machine. | ||
| 3. The file is automatically uploaded to the virtual filesystem at **`/files/uploads/`**. | ||
| 4. In the File Dialog, navigate to `/files/uploads/` and select the file to load it into the applet. | ||
|
|
||
| ### Integrated Download | ||
|
|
||
| Similarly, if you use a "Save" File 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. | ||
48 changes: 48 additions & 0 deletions
48
sites/labs/src/content/docs/cheerpj-jnlp-runner/04-guides/debug-builds.mdx
This file contains hidden or 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,48 @@ | ||
| --- | ||
| title: How to debug the extension | ||
| 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. | ||
|
|
||
| > [!important] Reload Required | ||
| > You must enable the debugging mode **before** loading your application, or **reload the page** after enabling it. Otherwise, the setting will not take effect. | ||
|
|
||
| ## 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, it is important to open the browser's developer tools directly on the **"start application"** page (the intermediate page that appears before the application launches). This makes sure the logs are complete from the beginning. | ||
|
|
||
| 1. On the "start application" screen, 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 | ||
|
|
||
| 1. With the developer tools open, navigate to the **Console** tab. (If you don’t see it, click the `+` symbol in Edge or `>>` in Chrome, then select Console). | ||
| 2. If needed, trigger the error in your application. | ||
| 3. Right-click on any message in the console tab and select **Save as…** | ||
| 4. Save the console log to a file. | ||
|
|
||
| ### Step 3: Extract a HAR File | ||
|
|
||
| A HAR (HTTP Archive) file logs your browser's network interactions and helps us diagnose loading or server responses. | ||
|
|
||
| 1. In the developer tools, navigate to the **Network** tab. | ||
| 2. Continue with starting your application to ensure all network requests are captured. | ||
| 3. Trigger the error in your application if needed. | ||
| 4. Click the download icon (`↓`) at the top right of the Network tab to export and save the HAR file. | ||
|
|
||
| --- | ||
|
|
||
| Once you have collected these files, please attach them to your support request or bug report. |
48 changes: 48 additions & 0 deletions
48
sites/labs/src/content/docs/cheerpj-jnlp-runner/04-guides/file-handling.mdx
This file contains hidden or 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,48 @@ | ||
| --- | ||
| title: Upload and download files | ||
| description: How to interact with the local filesystem using the JNLP Runner extension | ||
| --- | ||
|
|
||
| For a deeper dive into how file systems work in CheerpJ, check out the [File System explanation guide](https://cheerpj.com/docs/explanation/File-System-support). | ||
|
|
||
| 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. | ||
|
|
||
| > [!note] Pin the extension | ||
| > If you cannot see the extension popup icon, you may need to pin the extension to your browser's toolbar. | ||
|
|
||
| ### Uploading files | ||
|
|
||
| The upload button is only available in the extension popup **once a Java application is already running**. 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 filesystem (your machine). | ||
| 3. The files will be automatically placed in the **`/files/uploads/`** virtual directory. | ||
|
|
||
| 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/`** virtual directory will be automatically detected and downloaded by your browser to your local machine (usually your default Downloads folder). | ||
|
|
||
| To export data, simply ensure the application's save path is set to `/files/downloads/`. | ||
|
|
||
| ## Method 2: Using the built-in file picker | ||
|
|
||
| If the Java application uses a standard Java File Dialog (for example, `JFileChooser`), CheerpJ provides an integrated way to handle local files without leaving the application's UI. | ||
|
|
||
| ### Integrated Upload | ||
|
|
||
| The upload icon (an upward arrow) is present as part of the title bar on any window, frame, or File Dialog that opens. | ||
|
|
||
| 1. Click the **upload icon** in the title bar. | ||
| 2. Select a file from your local machine. | ||
| 3. The file is automatically uploaded to the virtual filesystem at **`/files/uploads/`**. | ||
| 4. In the File Dialog, navigate to `/files/uploads/` and select the file to load it into the application. | ||
|
|
||
| ### Integrated Download | ||
|
|
||
| Similarly, if you use a "Save" File 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. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This sections should be called something like
Using the window title barThen explain then windows/frames/dialogs that have a title bar will have a new upload icon. The main Applet frame is normally undercoated, meaning it has no title bar, so mentioning file dialogs and extra windows is useful here.