Open
Conversation
This will automatically download the raw content on page load and then closes the tab.
"*://raw.githubusercontent.com/*", "activeTab", "pageCapture", "downloads"
houndci-bot
reviewed
Feb 14, 2022
| let fileName = tab.url.split('/').slice(-1).pop(0); | ||
| console.log(`Found Path ${tab.url}`); | ||
| console.log(`Found file name ${fileName}`); | ||
| console.log(`Closing tab & sending download`); |
Collaborator
There was a problem hiding this comment.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
| function savePage(tab,id) { | ||
| let fileName = tab.url.split('/').slice(-1).pop(0); | ||
| console.log(`Found Path ${tab.url}`); | ||
| console.log(`Found file name ${fileName}`); |
Collaborator
There was a problem hiding this comment.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
| }) | ||
| function savePage(tab,id) { | ||
| let fileName = tab.url.split('/').slice(-1).pop(0); | ||
| console.log(`Found Path ${tab.url}`); |
Collaborator
There was a problem hiding this comment.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
| } | ||
| }) | ||
| function savePage(tab,id) { | ||
| let fileName = tab.url.split('/').slice(-1).pop(0); |
Collaborator
There was a problem hiding this comment.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
| savePage(tab,tab.id); | ||
| } | ||
| } | ||
| }) |
| document.querySelector('.files') && | ||
| document.querySelector('.files').contains(node) && | ||
| document.querySelector('.file') === null; | ||
| return node.classList.contains('download-btn') //&& // octicon-file // octicon-file-text |
| this.downloadIt(href, linkNode.textContent); | ||
| var linkNode = event.currentTarget.parentNode.nextElementSibling.querySelectorAll('a:not(.tooltipped)')[0]; | ||
| // var href = linkNode.href.replace('\/blob\/', '\/raw\/'); | ||
| let href = linkNode.href.replace('/raw/','/'); |
Collaborator
There was a problem hiding this comment.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checks when raw github page is open when clicking download. Then downloads the content and closes the tab.