The failure of invoking a batch file using custom protocol in Windows 10 JavaScript

I recently made a new entry in the Registry (following instructions from this helpful post). The entry can be seen in the snapshot below:

https://i.sstatic.net/InZyg.jpg

After creating this entry, I used the code snippet below to confirm that the Batch script is being executed from a JavaScript function:

Save_Result = async () => {
                        const location = window.location.hostname;
                        const settings = {
                                            method: 'POST',
                                            headers: {
                                                        Accept: 'application/json',
                                                        'Content-Type': 'application/text',
                                                     }
                                         };
                  try {
                  const fetchResponse = await fetch(`FDMyAlbsIF: "asdads" "dfgdfg" "dfgdfgert"` , settings);
        const data = await fetchResponse.text;
        return data;
    } catch (e) {
        return e;
    }    
}
Save_Result () ;

However, I encountered an error message indicating that something was not quite right:

Fetch API cannot load fdmyalbsif: "asdads" "dfgdfg" "dfgdfgert". URL scheme "fdmyalbsif" is not supported.

This leaves me wondering - where did I go wrong?

Answer №1

After successfully implementing the Custom Protocol definition in the Registry as recommended by David and testing it in Windows Explorer, everything is functioning properly. However, there are still a few challenges that need to be addressed, which are outlined in detail in this thread.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

SSL handshake failure in Firefox when making cross-domain requests with client certificates over xhr

The scenario is as follows: Using Firefox (versions 3.x and 4b) with functioning certificates, including a client certificate. Accessing a web page with an AJAX call using the XMLHttpRequest() method to a different subdomain. A custom web server located ...

Using jQuery to track the status of checkboxes

Changing the checkbox status using the code: $(this).attr("checked", 'checked'); However, when trying to check the checkbox status afterwards, I received the following results: $(this).attr('checked'): "checked" $(this).is(':chec ...

Angular 10: handling undefined error even with if statement checking for null values

After fetching a product from the backend, I ensure that if it contains images, they are also loaded. This functionality is already functioning properly when images are present. However, I need to implement a conditional check to skip products without imag ...

When attempting to check and uncheck checkboxes with a specific class, the process fails after the first uncheck

I have a set of checkboxes and one is designated as "all." When this box is clicked, I want to automatically select all the other checkboxes in the same group. If the "all" box is clicked again, I would like to deselect all the other checkboxes. Currently ...

The width of the table remains consistent

I have created a division that includes two tables stacked on top of each other. However, I am facing an issue where the width of the second table remains fixed and does not change even when I try to increase it. Here is the code snippet below: functio ...

Why is the Zip archive downloader not functioning properly when using Node.js and Archiver (Unexpected end of archive error)?

Looking to download multiple files using archiver with express. The server should respond to a post request from the client by sending a .zip file. However, there seems to be an issue where WinRAR displays an error message "! 98I9ZOCR.zip:Unexpected end of ...

Incorporating a JavaScript variable into an inline HTML onclick event

Having trouble passing a variable into an inline onclick function. I've tried researching and following suggestions from this link, but encountered errors (Uncaught SyntaxError: missing ) after argument list): pass string parameter in an onclick func ...

Utilizing JavaScript to retrieve a property from within a method

How can I access a property from inside an object? Manually entering its path allows me to retrieve the property, but not when attempting to do it dynamically. What am I missing in the code snippet below? var myApp = { cache : {}, init: function( ...

AJAX function designed to send and receive 4 specific variables using the POST

My frustration has been building for hours as I struggle to recall my AJAX! I am attempting to create a function that will send 4 variables via POST to a specified URL, using JavaScript instead of jQuery. Here is an example of what I have so far: functio ...

Instructions on invoking a function from one controller within another controller

Is it possible to invoke a function from one controller in another controller? I attempted the following but encountered failure: <div ng-app="MyApp"> <div ng-controller="Ctrl1"> <button ng-click="func1()">func1</button> ...

ways to validate the calling function in jquery

One of the challenges I'm facing is identifying which function is calling a specific error function that is used in multiple places within my code. Is there a method or technique to help determine this? ...

Utilize the ng.IFilterService interface within a TypeScript project

I am facing an issue with a .ts file that contains the following code: module App.Filters { export class SplitRangeFilter implements ng.IFilterService { static $inject = ['$filter']; public static factory(): Function { ...

CKEditor Missing Plugin Icon for YouTube Video Embedding

After following the instructions on how to add a Youtube plugin in CKEditor and adding the code to config.js, I was disappointed to find that the youtube insert button did not show up on the toolbar. My next step was downloading and extracting the Youtube ...

Testing Events in Redux using Mocha

I have been developing a React component that consists of a field and a Submit button. The event 'onMapPointAdded' is triggered when users enter text and click the Submit button. I am looking for guidance on how to test this functionality. Any ...

Leaving out the return statement in an asynchronous typed function

Consider this example: export async function foo(): Promise<string>{ await bar() return; } No errors are thrown during compilation. However, if you change the code to: export async function foo(): Promise<string>{ await bar() } You w ...

Struggling to eliminate placeholders using regular expressions in JavaScript

In my dynamically generated table, I have some placeholders that need to be removed. These placeholders are in the format of {firm[i][j]}, where i and j are numbers. I attempted to use a regular expression in JavaScript to remove them, but it didn't ...

Exploring the Next.js Route API to Retrieve and Utilize Request Body Data

I've been experimenting with the new Route API's in Next v13.2, but I'm facing some difficulty in extracting the body values from a POST request. When calling the API on the client side, my code looks something like this: const respon ...

Is it feasible to create a translucent overlay that sits atop another element without hindering or intercepting mouse clicks using CSS and JavaScript?

I'm looking to overlay one layer on top of another without capturing input. My aim is to place a PNG image over my webpage in order to achieve a filter-like effect. The issue I'm facing is that when the overlay is in place, the text becomes uns ...

Strategies for maintaining pristine Firebase child paths

I have a list of data that I want to structure in Firebase. However, I encountered an error: Error: Firebase.child failed: The first argument provided is not a valid path. Path names should not include ".", "#", "$", "[", or "]" characters and must be no ...

When rendering a PNG image with an alpha channel, three.js has been reported to leak pixels from the videocard

Struggling to come up with a suitable title for my question here.. I'm encountering an issue when loading PNG files from an external URL, specifically with one PNG that has a non-power-of-two alpha channel created in Gimp. When I load and use this PNG ...