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
Fixed download button #56
base: master
Are you sure you want to change the base?
Conversation
This will automatically download the raw content on page load and then closes the tab.
"*://raw.githubusercontent.com/*", "activeTab", "pageCapture", "downloads"
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`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
} | ||
}) | ||
function savePage(tab,id) { | ||
let fileName = tab.url.split('/').slice(-1).pop(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
savePage(tab,tab.id); | ||
} | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
document.querySelector('.files') && | ||
document.querySelector('.files').contains(node) && | ||
document.querySelector('.file') === null; | ||
return node.classList.contains('download-btn') //&& // octicon-file // octicon-file-text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
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/','/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Checks when raw github page is open when clicking download. Then downloads the content and closes the tab.