Code Monkey home page Code Monkey logo

chrome-extension_open-local-file-link's Introduction

( English / Français(French) / 日本語(Japanese) )

Enable local file links

Unlike IE, Chrome can not open a link to a local file (file://). This extension allows you to open a local file link.

  1. Click link to local file.
  2. The file opens.

Chrome Store

https://chrome.google.com/webstore/detail/nikfmfgobenbhmocjaaboihbeocackld

Todo

  • Open by clicking the local file link.
  • Ensure the security (restrict opening of links arbitrarily by JavaScript).
    • Make it possible to set the page that can be opened (confirm by notification). Change to the following method.
    • Make it open only when the user clicks (not the above confirmation by notification).
  • Link local file path in <pre> or <code>.
  • Make ppt, xls etc. open files directly (Native Messaging + registry change required).

Description for Chrome Store

./chrome-store/description/en.txt

chrome-extension_open-local-file-link's People

Contributors

dorianok avatar snooky-ch avatar tksugimoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chrome-extension_open-local-file-link's Issues

Enable "Allow access to file URLs" via policy

Hi,

We using this extension in our company with 1000+ employees.
Since the last update/changes every user have to enable "Allow access to file URLs" setting manually once.
It would be very helpful when we can enable this setting via a group policy or script. Would it be possible?

Does not work on some pages

Example page

  • Slack

Example file path

  • file://localhost/C:/Windows/

Cause

Intervening in click on the page side.

Target property

Hi, it's again me.
Target property is not taken into account.
I try all theses links and they all act like "_blank" target property.

<!doctype html>
<head>
</head>
<html>
	<body>
		<ul>
			<li><a href="file://C:/Temp" target="_blank">_blank</a>
			<li><a href="file://C:/Temp" target="_self">_self</a>
			<li><a href="file://C:/Temp" target="_parent">_parent</a>
			<li><a href="file://C:/Temp" target="_top">_top</a>
			<li><a href="file://C:/Temp" target="framename">framename</a>
		</ul>
		<iframe id="framename" name="framename">
		</iframe>
	</body>
</html>

The last kind of target should load the directory view into the frame, as in IE :

image

But it is load in a new tab in Chrome with this extension, not in the frame :

image

The same thing happen when I create another page which is a frame of the first one and when i use _self target value.

Only works once

Hi,
Thanks for this usefull extension.
When I set up the extension frome the Google Store, it works fine : I can get local file and local folder.
But if I close Chrome and start again Chrome. It does not work anymore.
The extension is still set up and active.
I have this problem on two PC, running the version 59 of Chrome.
I have not try on another PC.
In the browser console, the famous message saying that we cannot load local file is written.

Publish your extension to Microsoft Edge Addons website

Microsoft Edge is the second most used browser on the web, making the browsing experience more flexible, offering many more services for users and optimized for Windows devices.

Microsoft Edge supports Chromium extensions, and you can publish your extensions to Microsoft Edge Add-ons website with minimal code changes. Find out more here.

If you have any more queries about porting Chrome extension to Microsoft Edge or anything else, you can contact the relevant teams whose links are given here.

Let me know if this was helpful. I am happy to help you with more details.

[Feature request] Specify domains where this is allowed

I want to use this plugin at my users of an intranet page. But I don't want to allow all websites (including malicious ones) to open local files. So I would like to have an option to only allow opening links on certain domains. I am a full-stack programmer, but have no experience in developing Chrome plugins, but I am happy to help.

Only lists root directory of a network path

If I use this to connect to a network path, e.g. file://foo/Group$, I will get the directory listing as expected, but when I click on one of the folders, let's say if is called 'bar' I get the error of file not found.

Inspecting the console, I notice it is trying to access file://group%24/bar, instead of the correct path:
file://foo/Group$/bar. If I manually enter file://foo/Group$/bar I get the directory listing as expected.

network link file

Hello,

It seems that Chrome doesn't open files located on private networks but a copy of the file.
Is it possible to open the original file ?

Best regards,
SLNL

Override style

Another question. Is it possible to modify CSS of a directory view in Chrome ?

If you are interested, your extension could propose some themes (CSS stylesheet) to improve directories views ?

In this case, I would appreciate to contribute.

Does not work when configured via GPO (Chrome 119)

Restricting use of file: URLs in tabs and windows APIs

In particular, there is some code here which basically prevents things from working unless the file access checkbox is enabled. Unfortunately since the policy and checkbox aren't linked that check is failing.

		const canOpen = await chrome.extension.isAllowedFileSchemeAccess();
		if (!canOpen) {
			openTab(chrome.runtime.getURL('/options/index.html#need-file-scheme-access'), tab);
			return;
		}
		openTab(localFileUrl, tab);

problematic PR/commit

  • #26
    • 896f831 feat: Add settings page to guide feature activation · tksugimoto/chrome-extension_open-local-file-link@896f831

problematic version

  • v0.9.1
  • v0.9.2
  • v0.9.3 (Latest as of 2023/11/02)

PR

Easy way to open Office files

I noticed this Todo: open Office documents directly.

Office (and Libre Office) install URI schemes for Office documents. They bypass the Chrome file link restriction. So rewriting the links with the document-specific URI scheme in front should accomplish this goal. For example:

Chrome behavior (without plugin)

  • File link: file:///C:/test.docx -- doesn't open
  • Word link: ms-word:ofv|u|file:///C:/test.docx -- opens directly in Word

The Office document schemes can be found here.

Caveats

If the computer does not have registered handlers (i.e. Office is not installed), these links will be ignored and a console error will be logged. So it would be ideal to rewrite the links only if there are registered handlers. So the plugin will still allow them to be downloaded if Office is not installed.

Broken in latest chrome update?

This extension has always worked flawlessly for me in the past -- thank you for developing it! However, it seems to no longer function now with the latest update to Chrome:

Version 118.0.5993.70 (Official Build) (64-bit)

This just happened in the past 3 days or so. I've replicated this behavior on two different machines (when you click on a local link, nothing happens).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.