-
Notifications
You must be signed in to change notification settings - Fork 20
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
links that use the handlebar helper function 'link' will now open in a new tab #43
base: master
Are you sure you want to change the base?
links that use the handlebar helper function 'link' will now open in a new tab #43
Conversation
Hmm, does this leave that blank new tab open after you accept the download? |
Yes the blank new tab stays open after you accept the download. I wasn't sure how to add JavaScript to the link.js file to close the tab since I kept running into the issue of Can you please explain to me why it console logs that message and how I could add my own JavaScript code to that file? |
Extensions aren't allowed to have inline javascript, as part of the security model. You have to separate it out or inject it through the proper APIs. That said, I don't know if opening a new tab and then closing it is much of an improvement over what we have. I'd really like to have the download open without having to leave the page if possible. |
So interestingly enough, I was testing this the other day and I don't have the problem you're describing. When I click the download PEM link, it just pops up a download window and leaves me on that page. Do you have any special tweaks that you've done to your firefox installation? |
The links under the "Miscellaneous" section, such as the PEM link, aren't using the link.js helper function, which is why the user isn't redirected. Whereas the rest of the links on the certificate viewer are using the links.js helper function. Example: I don't think I've modified anything on my firefox installation. |
Okay, so I don't think Pass a message to the backend code.
|
How I would approach this issue is I would use a fetch request to retrieve things like the CRLs and then using the Blob API and the download package to have users download the files. Unfortunately, I can not continue working on this issue. Please assign this issue to someone else. Thank you. |
Referenced Issue - #38
I wasn't sure how to have the download dialog appear on the same page without having the page turn white. Instead, the download will open on a new tab so that users won't have to refresh the certificate viewer.
I tried to use the code below inside link.js to have the download page open in a new tab and then close the new tab to have the dialog box appear without the new tab.
const handleLinkClick = url => { window.open(url).close(); return false; }
<a href="${new URL(url).href}" onclick="${() => handleLinkClick(url)}">${Handlebars.Utils.escapeExpression(text)}</a>
but I ran into "Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”)." inside the console.
`