Chrome - Disable file:/// protocol

Is there a way to disable file:/// protocol in google chrome?

Is there some option, or some switches that can disable this feature?

Please help


You can use an chrome extension to block file://

In the policies force install an extension that redirects all file:// urls to a blocked page. Example code:

chrome.tabs.query({currentWindow: true, active: true}, function(tabs){
    if(tabs[0].url.startsWith('file://')) {
         chrome.tabs.update('{blocked page}')
    }
});

Remember to replace blocked page to match the actual blocked page.


Is there a way to disable file:/// protocol in google chrome?

There is no switch to do this listed in the List of Chromium Command Line Switches.

URLProtocolView v1.15 - View/Enable/Disable URL protocols from Nirsoft seems to do what you want.

Description

URLProtocolView is a simple utility that displays all URL protocols (for example: ftp:, telnet:, mailto:) that are currently installed on your system. For each URL protocol, the following information is displayed: The protocol name, the protocol description, the command-line that is executed when you type or click the URL, the product name, and the company name.

This utility also allows you to easily enable/disable the URL protocols.