markdown-viewer
markdown-viewer copied to clipboard
Activate extension on certain file:// URLs
Thanks for the great work!
I have a mapping in my .vimrc file to launch the current Markdown file in Chrome:
autocmd BufEnter,FileType markdown nnoremap <F9> :execute ':silent !google-chrome %'<CR>
However, there's an extra step to activate the plugin on the page. Is there a way to automatically activate the plugin on user-defined file paths?
No, you can only allow it on all file:// URLs, is that the extra step you are referring to?
No, I mean that you have to click on the extension to reload the page with the markdown parsed...
You mean clicking on the extension button to show up the popup? I honestly don't understand.
Right, first, the markdown is rendered as HTML text (not compiled), then you click the extension button, then you click reload, then the markdown compiler kicks in.
Is there a way that, for certain file URLs, we can skip to the last step?
On Sun, Jan 27, 2019 at 1:21 PM simo [email protected] wrote:
You mean clicking on the extension button to show up the popup? I honestly don't understand.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/simov/markdown-viewer/issues/82#issuecomment-457955462, or mute the thread https://github.com/notifications/unsubscribe-auth/ACmkd_U7PDDGYJQH9rUATM4l9Sk1HbZ-ks5vHhh1gaJpZM4aUjLS .
-- Victor Alvarez
That's a new Chrome feature where you can control the extension's permissions. You have to navigate to chrome://extensions, find Markdown Viewer and click on the Details button. Scroll down to the Permissions section, and instead of On Click, choose On All Sites.
It's a new feature in Chrome aimed at extensions that require access to all sites during install. Markdown Viewer does not require any permissions at install time, so even if you choose On All Sites, the extension will be able to access only what you have explicitly allowed for it in the Advanced options page of the extension itself, and/or will be able to access file:// URLs if that's enabled for the extension.
I actually tried implementing this one only the realize at some point that it is not supported: https://developer.chrome.com/docs/extensions/reference/permissions/#method-request
Paths on origin patterns will be ignored.
So make sure that the extension is enabled for the file:/// origins and the access to file URLs is enabled, that way you won't be required to click on the extension button in order to render the page.