Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fixed download button #56

wants to merge 5 commits into from

Conversation

richiecc
Copy link

Checks when raw github page is open when clicking download. Then downloads the content and closes the tab.

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`);
Copy link
Collaborator

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}`);
Copy link
Collaborator

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}`);
Copy link
Collaborator

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);
Copy link
Collaborator

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);
}
}
})
Copy link
Collaborator

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
Copy link
Collaborator

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/','/');
Copy link
Collaborator

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants