Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Open all files with/files path except for.html and .svg`#2449

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
takluyver merged 11 commits intojupyter:masterfromgnestor:issue-2404
Jun 21, 2017

Conversation

@gnestor
Copy link
Contributor

Closes#2404

@gnestor
Copy link
ContributorAuthor

@takluyver Can you review?

@takluyver
Copy link
Member

.htm should be treated this way as well, it's a common extension for html files. I wonder if we should be doing it on mime type instead of extension - I think anything that our server offers with mimetypetext/html can have the same effect, and that can vary by system. In some cases, installed apps can affect what extensions are recognised for a mimetype.

@minrk@rgbkrk do you know of any file types other than html and svg that we should be displaying in the iframe?

@minrk
Copy link
Member

minrk commentedApr 28, 2017
edited
Loading

It's probably best to avoid a 'not_safe' blacklist, because it's easy to miss things (like the many synonyms for html) instead having a 'safe' list for things that can be trusted to be displayed raw. It seems like it makes more sense to specify a list of things thatdon't work in the iframe (are there examples other than PDF?)

rgbkrk reacted with thumbs up emoji

@gnestor
Copy link
ContributorAuthor

I updated so thatis_viewable is used in place ofis_not_safe (just includeshtm andhtml). Every other file extensions that isn't editable will be opened using the/files path and handled by the browser. I also updated theis_editable list to be more comprehensive (using the list fromhttps://github.com/sindresorhus/text-extensions/blob/master/text-extensions.json).

@takluyver
Copy link
Member

Isn't that the same blacklisting approach just with the name 'viewable' in place of 'not_safe'?

I seexht,xhtml,mht andmhtml in the editable list - in certain circumstances, any of these could be rendered as HTML in a browser, so viewing them should open them in the iframe. This rather validates Min's point about the problems with a blacklist.

@gnestorgnestor added this to the5.1 milestoneMay 30, 2017
@gnestor
Copy link
ContributorAuthor

I have updated this PR. The way it works now:

  • By default, all files (not directories) are opened using/files prefix and display the "View" button
  • If a file is html (according to the list of html extensions andtext/html mime type), it's opened using the/view prefix
  • If a file is editable (according to the list of editable extensions andtext/* andapplication/* mime types), it's opened using the/edit prefix and displays the "Edit" button
  • If a file is a notebook, it's opened using the/notebooks prefix
    • Notebooks can be edited in the text editor using the "Edit" button

@takluyvertakluyver merged commitce56217 intojupyter:masterJun 21, 2017
@gnestorgnestor mentioned this pull requestAug 3, 2017
@gnestorgnestor deleted the issue-2404 branchOctober 12, 2017 22:35
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsApr 5, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

5.1

Development

Successfully merging this pull request may close these issues.

Sandboxed iframe in the ViewHandler not rendering PDFs

3 participants

@gnestor@takluyver@minrk

[8]ページ先頭

©2009-2025 Movatter.jp