-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
17 lines (16 loc) · 752 Bytes
/
main.js
File metadata and controls
17 lines (16 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// This file includes the main logic of the extension,
// you can import other files here using conventional
// 'require' syntax.
// Example:
// const myModule = require('./myModule');
// extract function is called when the extension is
// activated once the url to download has matched this
// extension's regex pattern.
// This function should return the actual url to download.
// Example:
// let url be https://example.com/view/12345 but the actual download link is https://example.com/download/12345
// so the extract function should return https://example.com/download/12345 and hence we will replace
// 'view' with 'download' in the url to get the actual download link.
function extract(url) {
return url.replace('view', 'download');
}