Skip to content

Fixed download button#56

Open
richie8675309 wants to merge 5 commits intocamsong:masterfrom
richie8675309:master
Open

Fixed download button#56
richie8675309 wants to merge 5 commits intocamsong:masterfrom
richie8675309:master

Conversation

@richie8675309
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.

2 participants

Comments