### AutoInstall Property Source: https://context7.com/susbox/fireshot-api/llms.txt A boolean property that controls whether the API automatically prompts users to install the FireShot extension when it's not detected. Defaults to true. ```APIDOC ## AutoInstall Property ### Description Boolean property that controls whether the API should automatically prompt users to install the FireShot extension when it's not detected. Set to `true` by default. ### Method `FireShotAPI.AutoInstall` ### Parameters None ### Request Example ```javascript // Disable auto-installation prompts for silent operation FireShotAPI.AutoInstall = false; // Now capture methods won't show installation prompts if (FireShotAPI.isAvailable()) { FireShotAPI.savePage(true, undefined, "screenshot.png"); } else { // Handle missing extension silently showCustomInstallMessage(); } // Enable auto-installation (default behavior) FireShotAPI.AutoInstall = true; ``` ### Response #### Success Response (boolean) - `true`: Auto-installation prompts are enabled. - `false`: Auto-installation prompts are disabled. #### Response Example ```json true ``` ``` -------------------------------- ### isAvailable Source: https://context7.com/susbox/fireshot-api/llms.txt Silently checks if the FireShot browser extension is installed and available without user interaction. Returns true if ready, false otherwise. ```APIDOC ## isAvailable ### Description Silently checks whether the FireShot browser extension is installed and available. Returns `true` if the extension is ready, `false` otherwise. This method does not display any messages to the user. ### Method `FireShotAPI.isAvailable()` ### Parameters None ### Request Example ```javascript if (FireShotAPI.isAvailable()) { console.log("FireShot is installed and ready!"); // Proceed with screenshot capture FireShotAPI.editPage(true); } else { console.log("FireShot extension not detected"); // Show custom installation message or fallback behavior } ``` ### Response #### Success Response (boolean) - `true`: The FireShot extension is installed and available. - `false`: The FireShot extension is not installed or not available. #### Response Example ```json true ``` ``` -------------------------------- ### Configure FireShot API Auto-Installation Source: https://github.com/susbox/fireshot-api/blob/master/demo3.htm This code snippet demonstrates how to configure the FireShot API's auto-installation feature. Setting FireShotAPI.AutoInstall to true enables automatic addon installation, while setting it to false disables this feature. This is useful for managing addon installations or troubleshooting. ```javascript FireShotAPI.AutoInstall = true; // Set this to *false* to avoid addon auto-installation if missed. ``` -------------------------------- ### Configure Auto-Installation behavior Source: https://context7.com/susbox/fireshot-api/llms.txt The AutoInstall property toggles whether the API automatically prompts users to install the FireShot extension. Setting this to false allows for silent handling of missing extension scenarios. ```javascript FireShotAPI.AutoInstall = false; if (FireShotAPI.isAvailable()) { FireShotAPI.savePage(true, undefined, "screenshot.png"); } else { showCustomInstallMessage(); } FireShotAPI.AutoInstall = true; ``` -------------------------------- ### Check FireShot extension availability Source: https://context7.com/susbox/fireshot-api/llms.txt Methods to verify if the FireShot extension is installed. isAvailable performs a silent check, while checkAvailability provides user-friendly feedback and troubleshooting prompts. ```javascript if (FireShotAPI.isAvailable()) { console.log("FireShot is installed and ready!"); FireShotAPI.editPage(true); } else { console.log("FireShot extension not detected"); } document.addEventListener("DOMContentLoaded", function() { setTimeout(function() { if (FireShotAPI.checkAvailability()) { document.getElementById("captureBtn").disabled = false; } else { document.getElementById("captureBtn").disabled = true; } }, 1000); }); ``` -------------------------------- ### Capture Screenshot as Base64 Data URL - JavaScript Source: https://context7.com/susbox/fireshot-api/llms.txt Captures a screenshot of the current page or a specific element and returns it as a BASE64-encoded data URL. This is useful for embedding images directly into HTML or sending to a server without file downloads. It requires the FireShot browser extension to be installed. ```javascript function screenshotToBase64(captureEntirePage) { FireShotAPI.base64EncodePage(captureEntirePage, undefined, function(data) { // Open in new window var w = window.open('', 'Captured Image', 'width=800,height=600,toolbar=1,scrollbars=1'); w.document.write('Preview base64 image'); w.document.write('

Captured image embedded into HTML by JavaScript.

'); var img = w.document.createElement("IMG"); img.style = "max-width:100%; height:auto"; img.src = data; // data is a base64 data URL w.document.body.appendChild(img); }); } // Capture entire page as base64 document.getElementById("base64FullBtn").onclick = function() { screenshotToBase64(true); }; // Capture visible area as base64 document.getElementById("base64VisibleBtn").onclick = function() { screenshotToBase64(false); }; // Send screenshot to server document.getElementById("serverUploadBtn").onclick = function() { FireShotAPI.base64EncodePage(true, undefined, function(base64Data) { fetch('/api/screenshots', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ image: base64Data }) }) .then(response => response.json()) .then(result => console.log("Saved:", result.id)); }); }; ``` -------------------------------- ### Check FireShot API Status (JavaScript) Source: https://github.com/susbox/fireshot-api/blob/master/demo1.htm This function checks if the FireShot API is available by looking for the 'FireShotAPI' object and calling its 'isAvailable' method. It then updates an HTML element with ID 'spnPluginStatus' to indicate whether the API is installed and ready or not, providing a link to a troubleshooting page if it's not available. ```javascript function checkFSAPI() { var element = document.getElementById("spnPluginStatus"); if (typeof (FireShotAPI) != "undefined" && FireShotAPI.isAvailable()) element.innerHTML = "Installed and ready!"; else element.innerHTML = "Not installed, please see the " + "troubleshooting page"; } ``` -------------------------------- ### Configure Auto-Installation and Capture Screenshot to Base64 (JavaScript) Source: https://github.com/susbox/fireshot-api/blob/master/demo2.htm This snippet demonstrates how to configure the FireShot API's auto-installation behavior and capture a screenshot of the entire webpage, encoding it as a base64 string. The captured image is then displayed in a new browser window. It depends on the FireShotAPI object being available in the global scope. ```javascript FireShotAPI.AutoInstall = true; function screenshotToBase64(mode) { FireShotAPI.base64EncodePage(mode, undefined, function (data) { var w = window.open('', 'View captured image', 'width=800,height=600,toolbar=1,scrollbars=1'); w.document.write('Preview base64 image'); w.document.write('

This is a captured image embedded into HTML by JavaScript.

'); var img = w.document.createElement("IMG"); img.style = "max-width:100%; height:auto"; img.src = data; w.document.body.appendChild(img); }); } ``` -------------------------------- ### Prompt User to Upgrade Plugin - JavaScript Source: https://context7.com/susbox/fireshot-api/llms.txt Initiates a prompt for the user to upgrade to the premium version of FireShot, enabling advanced features. This is typically called when a user attempts to access a premium feature without having the paid version. Requires the FireShot browser extension. ```javascript // Show upgrade prompt when user clicks premium feature document.getElementById("premiumBtn").onclick = function() { if (!isPremiumUser()) { FireShotAPI.upgradePlugin(); } else { FireShotAPI.editPage(true); } }; ``` -------------------------------- ### emailPage Source: https://context7.com/susbox/fireshot-api/llms.txt Captures a screenshot of the current web page and opens the default email client with the screenshot attached. ```APIDOC ## POST /emailPage ### Description Captures a screenshot of the current web page and opens the default email client with the screenshot attached, ready for sending. Useful for bug reporting or sharing. ### Method POST ### Endpoint /emailPage ### Parameters #### Query Parameters - **fullPage** (boolean) - Required - `true` to capture the entire page, `false` to capture only the visible area. - **elementId** (string) - Optional - The ID of a specific element to capture. If not provided, the entire page or visible area is captured based on the `fullPage` parameter. ### Request Example ```json { "fullPage": true } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the email client has been opened with the screenshot. #### Response Example ```json { "message": "Email client opened with screenshot" } ``` ``` -------------------------------- ### uploadPage Source: https://context7.com/susbox/fireshot-api/llms.txt Captures a screenshot of the current web page and uploads it to a free image hosting service, returning the URL of the hosted image. ```APIDOC ## POST /uploadPage ### Description Captures a screenshot of the current web page and uploads it to a free image hosting service. The API returns the URL of the hosted image, which can be used for sharing. ### Method POST ### Endpoint /uploadPage ### Parameters #### Query Parameters - **fullPage** (boolean) - Required - `true` to capture the entire page, `false` to capture only the visible area. - **elementId** (string) - Optional - The ID of a specific element to capture. If not provided, the entire page or visible area is captured based on the `fullPage` parameter. - **customData** (string) - Optional - Custom data to be associated with the upload. ### Request Example ```json { "fullPage": true, "customData": "custom-data" } ``` ### Response #### Success Response (200) - **url** (string) - The URL of the uploaded screenshot. #### Response Example ```json { "url": "https://example.com/screenshot.png" } ``` ``` -------------------------------- ### Email Page Screenshot with FireShot API Source: https://context7.com/susbox/fireshot-api/llms.txt Captures a screenshot and opens the default email client with the image attached. Includes support for HTML-based button triggers and callback handling. ```javascript // Email entire page screenshot document.getElementById("emailBtn").onclick = function() { FireShotAPI.emailPage(true); }; // Email visible portion for bug reporting document.getElementById("reportBugBtn").onclick = function() { FireShotAPI.emailPage(false, undefined, function() { console.log("Email client opened with screenshot"); }); }; ``` ```html ``` -------------------------------- ### checkAvailability Source: https://context7.com/susbox/fireshot-api/llms.txt Checks if the FireShot extension is available and provides user-friendly prompts if it's not. It alerts unsupported browsers and offers a troubleshooting page link if the extension is missing. ```APIDOC ## checkAvailability ### Description Checks whether the FireShot extension is available and displays user-friendly prompts if not. Shows an error alert for unsupported browsers and offers to open the troubleshooting page if the extension is missing. Returns `true` if available, `false` otherwise. ### Method `FireShotAPI.checkAvailability()` ### Parameters None ### Request Example ```javascript document.addEventListener("DOMContentLoaded", function() { // Wait for API initialization before checking setTimeout(function() { if (FireShotAPI.checkAvailability()) { document.getElementById("captureBtn").disabled = false; console.log("Ready to capture screenshots"); } else { document.getElementById("captureBtn").disabled = true; // User has already been notified via dialog } }, 1000); }); ``` ### Response #### Success Response (boolean) - `true`: The FireShot extension is installed and available. - `false`: The FireShot extension is not installed or not available (user has been prompted). #### Response Example ```json true ``` ``` -------------------------------- ### Copy Page to Clipboard with FireShot API Source: https://context7.com/susbox/fireshot-api/llms.txt Captures a screenshot and copies it to the system clipboard. Supports full-page, visible area, and specific element captures with optional callback functions. ```javascript // Copy entire page to clipboard document.getElementById("copyAllBtn").onclick = function() { FireShotAPI.copyPage(true, undefined, function() { showNotification("Screenshot copied to clipboard!"); }); }; // Copy visible area to clipboard document.getElementById("copyVisibleBtn").onclick = function() { FireShotAPI.copyPage(false); }; // Copy specific element to clipboard document.getElementById("copyChartBtn").onclick = function() { FireShotAPI.copyPage(true, "dataChart", function() { console.log("Chart copied to clipboard"); }); }; ``` -------------------------------- ### copyPage Source: https://context7.com/susbox/fireshot-api/llms.txt Captures a screenshot of the current web page (either the full page or the visible area) and copies it to the system clipboard. ```APIDOC ## POST /copyPage ### Description Captures a screenshot of the current web page and copies it directly to the system clipboard. This allows users to paste the screenshot into any application. ### Method POST ### Endpoint /copyPage ### Parameters #### Query Parameters - **fullPage** (boolean) - Required - `true` to capture the entire page, `false` to capture only the visible area. - **elementId** (string) - Optional - The ID of a specific element to capture. If not provided, the entire page or visible area is captured based on the `fullPage` parameter. ### Request Example ```json { "fullPage": true, "elementId": "dataChart" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the screenshot was copied. #### Response Example ```json { "message": "Screenshot copied to clipboard!" } ``` ``` -------------------------------- ### printPage Source: https://context7.com/susbox/fireshot-api/llms.txt Captures a screenshot of the current web page and sends it directly to the printer. ```APIDOC ## POST /printPage ### Description Captures a screenshot of the current web page and sends it directly to the printer. This allows for quick printing of web content. ### Method POST ### Endpoint /printPage ### Parameters #### Query Parameters - **fullPage** (boolean) - Required - `true` to capture the entire page, `false` to capture only the visible area. - **elementId** (string) - Optional - The ID of a specific element to capture. If not provided, the entire page or visible area is captured based on the `fullPage` parameter. ### Request Example ```json { "fullPage": true, "elementId": "reportContainer" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the print dialog has been opened. #### Response Example ```json { "message": "Print dialog opened" } ``` ``` -------------------------------- ### Print Page Screenshot with FireShot API Source: https://context7.com/susbox/fireshot-api/llms.txt Sends a screenshot directly to the system printer. Supports printing full pages, visible areas, or specific DOM elements. ```javascript // Print entire page screenshot document.getElementById("printBtn").onclick = function() { FireShotAPI.printPage(true); }; // Print visible area document.getElementById("printVisibleBtn").onclick = function() { FireShotAPI.printPage(false, undefined, function() { console.log("Print dialog opened"); }); }; // Print specific report element document.getElementById("printReportBtn").onclick = function() { FireShotAPI.printPage(true, "reportContainer"); }; ``` -------------------------------- ### Core Page Capture Method - JavaScript Source: https://context7.com/susbox/fireshot-api/llms.txt The fundamental method for capturing web page content, used internally by other capture functions. It allows for detailed control over capture behavior, including capture area, action type (save, clipboard, etc.), and output format (like Base64). Requires the FireShot browser extension. ```javascript // Action constants var cFSEdit = 0; // Open in editor var cFSSave = 1; // Save to disk var cFSClipboard = 2; // Copy to clipboard var cFSEMail = 3; // Email var cFSExternal = 4; // External editor var cFSUpload = 5; // Upload to hosting var cFSPrint = 7; // Print var cBASE64Encode = 8; // Return as base64 // Custom capture with full control // Parameters: EntirePage, Action, CapturedDivElementId, Data, Callback FireShotAPI.capturePage( true, // Capture entire page cFSSave, // Save action "myDiv", // Specific element ID (or undefined for full page) "filename.png", // Data parameter (filename for save action) function() { // Callback when complete console.log("Capture completed"); } ); // Capture specific element with base64 output FireShotAPI.capturePage(true, cBASE64Encode, "chartDiv", undefined, function(data) { document.getElementById("preview").src = data; }); ``` -------------------------------- ### exportPage Source: https://context7.com/susbox/fireshot-api/llms.txt Captures a screenshot of the current web page and opens it in a third-party image editor configured on the user's system. ```APIDOC ## POST /exportPage ### Description Captures a screenshot of the current web page and opens it in a third-party image editor configured on the user's system. Allows for immediate editing of the captured image. ### Method POST ### Endpoint /exportPage ### Parameters #### Query Parameters - **fullPage** (boolean) - Required - `true` to capture the entire page, `false` to capture only the visible area. - **elementId** (string) - Optional - The ID of a specific element to capture. If not provided, the entire page or visible area is captured based on the `fullPage` parameter. ### Request Example ```json { "fullPage": false } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the screenshot has been exported to the external editor. #### Response Example ```json { "message": "Screenshot exported to external editor" } ``` ``` -------------------------------- ### Capture and save screenshots to disk Source: https://context7.com/susbox/fireshot-api/llms.txt The savePage method captures a screenshot and triggers a file download. It supports optional parameters for element targeting, custom filenames, and completion callbacks. ```javascript document.getElementById("saveBtn").onclick = function() { FireShotAPI.savePage(true); }; document.getElementById("saveVisibleBtn").onclick = function() { FireShotAPI.savePage(false, undefined, "visible-screenshot.png", function() { console.log("Screenshot saved successfully"); }); }; document.getElementById("saveElementBtn").onclick = function() { FireShotAPI.savePage(true, "chartContainer", "chart-screenshot.png", function() { alert("Chart screenshot saved!"); }); }; ``` -------------------------------- ### Upload Page Screenshot with FireShot API Source: https://context7.com/susbox/fireshot-api/llms.txt Uploads a screenshot to a hosting service and retrieves the resulting URL. Useful for sharing screenshots via links or clipboard integration. ```javascript // Upload entire page screenshot document.getElementById("uploadBtn").onclick = function() { FireShotAPI.uploadPage(true, undefined, undefined, function(url) { if (url) { console.log("Screenshot uploaded to: " + url); document.getElementById("shareLink").value = url; } }); }; // Upload visible portion with custom data document.getElementById("shareBtn").onclick = function() { FireShotAPI.uploadPage(false, undefined, "custom-data", function(uploadedUrl) { navigator.clipboard.writeText(uploadedUrl); alert("Share link copied: " + uploadedUrl); }); }; ``` -------------------------------- ### editPage Source: https://context7.com/susbox/fireshot-api/llms.txt Captures a screenshot of the web page and opens it in the FireShot editor for annotation and editing. Can capture the entire page, visible viewport, or a specific element. ```APIDOC ## editPage ### Description Captures a screenshot of the web page and opens it in the FireShot editor for annotation and editing. The first parameter determines whether to capture the entire page (`true`) or just the visible viewport (`false`). The second parameter can specify an element ID to capture a specific part of the page. ### Method `FireShotAPI.editPage(captureFullPage, elementId, callback)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **captureFullPage** (boolean) - Required - `true` to capture the entire page, `false` for the visible viewport. - **elementId** (string) - Optional - The ID of the HTML element to capture. - **callback** (function) - Optional - A function to be called after the edit operation is completed. ### Request Example ```javascript // Capture entire page and open in editor document.getElementById("editEntireBtn").onclick = function() { FireShotAPI.editPage(true, undefined, function() { console.log("Edit operation completed"); }); }; // Capture only visible portion and open in editor document.getElementById("editVisibleBtn").onclick = function() { FireShotAPI.editPage(false); }; // Capture a specific div element only document.getElementById("editDivBtn").onclick = function() { FireShotAPI.editPage(true, "targetDivId", function() { console.log("Div captured and opened in editor"); }); }; ``` ### Response #### Success Response (void) This method does not return a value directly but triggers the FireShot editor. #### Response Example (No direct response body, opens the FireShot editor) ``` -------------------------------- ### savePage Source: https://context7.com/susbox/fireshot-api/llms.txt Captures a screenshot and saves it directly to the user's disk. Supports capturing the full page, visible viewport, or a specific element, with an option for a custom filename. ```APIDOC ## savePage ### Description Captures a screenshot and saves it directly to the user's disk. Accepts an optional filename parameter to specify the output file name. Can capture the entire page, visible viewport, or a specific element. ### Method `FireShotAPI.savePage(captureFullPage, elementId, filename, callback)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **captureFullPage** (boolean) - Required - `true` to capture the entire page, `false` for the visible viewport. - **elementId** (string) - Optional - The ID of the HTML element to capture. - **filename** (string) - Optional - The desired name for the saved screenshot file (e.g., "screenshot.png"). - **callback** (function) - Optional - A function to be called after the screenshot is saved. ### Request Example ```javascript // Save entire page with default filename document.getElementById("saveBtn").onclick = function() { FireShotAPI.savePage(true); }; // Save visible portion with custom filename document.getElementById("saveVisibleBtn").onclick = function() { FireShotAPI.savePage(false, undefined, "visible-screenshot.png", function() { console.log("Screenshot saved successfully"); }); }; // Save a specific element with custom filename document.getElementById("saveElementBtn").onclick = function() { FireShotAPI.savePage(true, "chartContainer", "chart-screenshot.png", function() { alert("Chart screenshot saved!"); }); }; ``` ### Response #### Success Response (void) This method initiates a file save operation. No direct response body is returned to the script. #### Response Example (Initiates file download prompt for the user) ``` -------------------------------- ### Export Page to External Editor with FireShot API Source: https://context7.com/susbox/fireshot-api/llms.txt Sends a captured screenshot to a third-party image editor configured on the user's system. Allows for full-page or visible area exports. ```javascript // Export entire page to external editor document.getElementById("exportBtn").onclick = function() { FireShotAPI.exportPage(true); }; // Export visible portion to external editor document.getElementById("exportVisibleBtn").onclick = function() { FireShotAPI.exportPage(false, undefined, function() { console.log("Screenshot exported to external editor"); }); }; ``` -------------------------------- ### Check FireShot API Availability (JavaScript) Source: https://github.com/susbox/fireshot-api/blob/master/demo2.htm This function checks for the availability of the FireShot API after a short delay. It's designed to be called after the DOM is fully loaded to ensure the API is initialized. The function relies on the FireShotAPI.checkAvailability method. ```javascript function checkAvailability() { setTimeout(function() { FireShotAPI.checkAvailability(); }, 1000); } document.addEventListener("DOMContentLoaded", checkAvailability); ``` -------------------------------- ### Capture and edit screenshots Source: https://context7.com/susbox/fireshot-api/llms.txt The editPage method captures a screenshot and opens it in the FireShot editor. It supports capturing the entire page, the visible viewport, or specific DOM elements by ID. ```javascript document.getElementById("editEntireBtn").onclick = function() { FireShotAPI.editPage(true, undefined, function() { console.log("Edit operation completed"); }); }; document.getElementById("editVisibleBtn").onclick = function() { FireShotAPI.editPage(false); }; document.getElementById("editDivBtn").onclick = function() { FireShotAPI.editPage(true, "targetDivId", function() { console.log("Div captured and opened in editor"); }); }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.