Coder Social home page Coder Social logo

tksugimoto / chrome-extension_open-local-folder-by-explorer Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 6.0 50 KB

Chromeからローカルフォルダーをエクスプローラーで開くChrome拡張

Home Page: https://chrome.google.com/webstore/detail/ehidkllolkmedbkjbdkcgabdadcfppfg

License: MIT License

HTML 27.97% JavaScript 71.70% Batchfile 0.33%
chrome-extension native-messaging nodejs windows registry windows-registry

chrome-extension_open-local-folder-by-explorer's Introduction

( English / 日本語(Japanese) )

Chrome Extension to open local folder in Explorer from Chrome

Function.

  • Open the folder in Explorer
  • (For files) Open the parent folder in Explorer with the file selected.

Targetable folders and files.

  • Current tab (if the URL starts with file://)
  • The URL of the link (if the URL begins with file://)
  • Selection string (if the selection string begins with C:\, \\ComputerName\, etc.)
    • The " (double quotation) at the beginning and end is ignored only when it exists at both the beginning and end.

⚠️ Notes.

In order to control the host side from Chrome, you need to do the following:

  • Install Node.js
  • Registry Changes

Usage.

  1. Install the extension
  2. Configure it according to the Setup tab opened at the time of installation.
    • If you need to reconfigure it, you can do so from the extension's options page
  3. Do one of the following
    • Click the icon for this extension on the tab for local files or folders
    • Select "Open ... in Explorer" from the context menu of page, link, and selected text
      • Open folder in Explorer
      • Open the link destination in Explorer (for local files)
      • Open the selected string in Explorer (for local file path)

Changing the title of the context menu.

Benefits.

If you change it to alphabetic, you can select it with the keyboard.

How to change.

  1. Open the settings page (option page)
  2. Set a new title for each type of context menu in the "Change the context menu title" part

Icons.

We have used the following material icons which can be downloaded from : icon material download site "icooon-mono" Folder Icons Web graphics Part 2.

chrome-extension_open-local-folder-by-explorer's People

Contributors

mijkami avatar tksugimoto avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

chrome-extension_open-local-folder-by-explorer's Issues

Initial settings using the registry registration file cannot be performed (surrogate pair)

If the directory path where you place host-app contains surrogate pairs.

There is no problem if you set it manually from the registry editor.

For example

𠮷 becomes

Cause code

chrome-extension_open-local-folder-by-explorer/main.js at v0.3.0 · tksugimoto/chrome-extension_open-local-folder-by-explorer

	/**
	 * Convert a string to a Uint16Array for UTF-16
	 * @param {String} str
	 * @returns {Uint16Array}
	 */
	const convertToUtf16 = str => {
		const codePointArray = Array.from(str).map(c => c.codePointAt(0));
		// TODO: Supports surrogate pairs (if codePoint is greater than 0xFFFF)
		return new Uint16Array(codePointArray);
	};

Can't open folder with "," in path. (","がpathに含まれるフォルダを開けない)

https://chrome.google.com/webstore/detail/open-local-folder-by-expl/ehidkllolkmedbkjbdkcgabdadcfppfg/support

,を含むフォルダについては、通知では正しいパス名を表示しているが、実際に開かれるフォルダは「ドキュメント」フォルダになります。

ファイルパスによる動作の違い

  • , なし: 開ける
    • aaa/
    • aaa/test.txt
    • bbb.txt
  • , あり・ (スペース) あり: 開ける
    • a,a a/
    • a,a a/test.txt
    • b,b b.txt
  • , あり・ (スペース) なし: 開けない
    • a,a/
    • a,a/test.txt
    • b,b.txt

参考

対策

  • フォルダ時
    • exec(`explorer "${path}"`)
      • ⚠️ サニタイズに注意
  • ファイル選択時
    • exec(`explorer /select,"${path}"`) とすればOK
      • ⚠️ サニタイズに注意
    • exec(`explorer "/select" "${path}"`) は上手く動かない
    • execFile('explorer', [`/select,"${path}"`] もNG

いずれにせよ、host app の更新が必要(なくても , 以外なら動く)

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.