Skip to content

Commit

Permalink
fix: folder open not working in devtools (#15387)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Oct 25, 2018
1 parent 1f3a891 commit d21d83c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion atom/browser/ui/inspectable_web_contents_impl.cc
Expand Up @@ -512,8 +512,9 @@ void InspectableWebContentsImpl::ShowItemInFolder(
const std::string& file_system_path) {
if (file_system_path.empty())
return;

base::FilePath path = base::FilePath::FromUTF8Unsafe(file_system_path);
platform_util::ShowItemInFolder(path);
platform_util::OpenItem(path);
}

void InspectableWebContentsImpl::SaveToFile(const std::string& url,
Expand Down
9 changes: 9 additions & 0 deletions lib/renderer/inspector.js
Expand Up @@ -4,10 +4,19 @@ window.onload = function () {
// Use menu API to show context menu.
window.InspectorFrontendHost.showContextMenuAtPoint = createMenu

// correct for Chromium returning undefined for filesystem
window.Persistence.FileSystemWorkspaceBinding.completeURL = completeURL

// Use dialog API to override file chooser dialog.
window.UI.createFileSelectorElement = createFileSelectorElement
}

// Extra / is needed as a result of MacOS requiring absolute paths
function completeURL (project, path) {
project = 'file:///'
return `${project}${path}`
}

window.confirm = function (message, title) {
const { dialog } = require('electron').remote
if (title == null) {
Expand Down

0 comments on commit d21d83c

Please sign in to comment.