Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URI-encode-on-open-html-file #398

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion desktop-app/app/main.dev.js
Expand Up @@ -91,7 +91,10 @@ const openWithHandler = filePath => {
filePath != null &&
(filePath.endsWith('.html') || filePath.endsWith('.htm'))
) {
const url = `file://${filePath}`;
// code to encode
// file URI
p1 = encodeURIComponent(filePath);
const url = `file://${filePath + p1}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aUsefulMethod Isn't filePath + p1 going to repeat the path twice?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe not work ... encodeURIComponent encode all of string :D

fileToOpen = url;
return true;
}
Expand Down