-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinject.js
59 lines (57 loc) · 9.7 KB
/
inject.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
window.addEventListener('load', function () {
const type = window.location.pathname.split("/")[1];
function addStyle(ele, name) {
name.split(" ").forEach((cls) => { ele.classList.add(cls) })
};
if (type === "p") {
const toolbar = document.querySelector('[data-lookup="view-page-toolbar"]').firstChild;
var image = chrome.runtime.getURL('assets/img/dl1.png');
button1 = document.createElement("a");
button1.setAttribute("title", "");
button1.setAttribute("data-lookup", "viewpage-embed-button");
button1.setAttribute("data-placement", "bottom");
button1.setAttribute("data-toggle", "tooltip");
addStyle(button1, "Styles__ToolbarButtonBase-sc-1dyyumc-0 Styles__ActionButton-sc-1dyyumc-2 Styles__RoundActionButton-sc-1dyyumc-4 dl-button");
button1.setAttribute("data-original-title", "Download");
button1.innerHTML = `<img id="dl-icon" src="${image}" style="width: 42px; height:42px;"alt="Download">`;
try {
toolbar.append(button1);
} catch (err) {
console.log(err);
};
button1.onclick = function () { genDL() };
}
});
window.addEventListener('load', function () {
$.notify.addStyle("bootstrap", {
html: "<div>\n<span data-notify-text></span>\n</div>",
classes: {
base: { "z-index": "99999", "font-size": "20px", "font-family": "Segoe UI, Frutiger, Dejavu Sans, Helvetica Neue, Arial, sans-serif", "padding": "10px 17px 10px 16px", "text-shadow": "0 1px 0 rgba(18, 18, 18, 0.5)", "color": "#EAEAEA", "background-color": "#101010", "border": "2px solid #161616", "border-radius": "10px", "white-space": "nowrap", "padding-left": "46px", "background-repeat": "no-repeat", "background-position": "8px 8px" },
error: { "color": "#E84A48", "background-color": "#260D0D", "border-color": "#331111", "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAARn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zSEryPjiF34Stqce0GSiFVnadXTDUEkiii9NcBIoTEJ2wek3mJiRcIiyFeS6ehtmxhQg/DeXZnIE6l7JgktvvuUTh7dtsSUKhJRZDKzdMrphYCSRRRDwkJpZZZK2Z47AunogAakJypGnq7QEZyyhs5juyFi/ZdNTTAHRwsJHhxcRSIQZJK0Q7rRTmihIKkvkVal1RJMto61NQE9+gR6GeeDkTT0/BGTyB7bhyZE+zDRFaNDYgPDsDpeC4gVJSP3Kx08/z9yQpKELFayzrDdpsJPeH7viffORGwTpnl5eDx6lUm9ij8qSkm9Sab0JmTnyJ75owdl9DaVoS8NuqfouGfw9cISiwCd7p6pHuUN/wphq3jDq+LwiS5Olpa4PR0IffDJPwrU7w1qyXMwbhcHQ31iD3fB39mBrlvv6FLWMXDcdkgw7XIHH2tZvzsaSssQRkhuVwJ/ZBW/bwIP2NNSnrFeSCJKuEUWUnRs8hfvnmEoRdJteMYJvQppvubifGzUfeFKCMk+D8/P+6icZ19oOWxrj5h81hXH/nFWDd/g0rxX/9R3MAGHjAA/wAR5Ut0pCrRawAAAABJRU5ErkJggg==)" },
success: { "color": "#1EC77D", "background-color": "#08331F", "border-color": "#062818", "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAXJSURBVFhH7VdbbBRVGP7PzM5OC9vSArZApRpugiXKlsTUqFEBH4iJ0UQFUqJEHjQxBEg0+uIlakz0AaIvXiIxctVojJEoKBAjCYEQKYgFubRYU25VusWldLuzM+f4/WdnaruX7iz6YsKXTE/PmbP/+c73X84Zuo4SEH57rTD8NhfKf8pGuYR4fpiFTL+VfhuaXNkKNW1ax01DpDo2g0yzTggxTikVISn7lVQJOZj+rX3pqtOY4+IZbj8UqZKEmvdsobaFrRTftZmweBMZ4lERte7Cq1tAol6Ypk2GQcpxJNqEMIxOmXEPkettb1vUuj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II4y6BflI6OK8RmHwrufnR5gdIKmVVjk+R5P5LrOvpu44MX5qU+6mqnV349QF0DST3Owf1h1y90LNmLmpOTVTnQqkt54OJn355Alydz5oyukDFmDF+6vsG0wyIyMhb4nOL42NHTRS8e20c/9fXQnj+7dVblpXgukO6In0HYfT95oI2LHBMprVAW4px03Q8Q4OnhrmOwSmNNi47+dYlehlLrOtrgKk+7dTQYFTbiwftUptM/XD1+mieHI8Q3OoU6gzvRNlTsjUY06r8ZCQ7s7lQ/nUtdHZ0MljQqK/gcOwR7rw+c6AxO7DwyjCIKaQyiHr2g3MzXenc5SjH4nLIKjA8BRI0xICNlB26MazFy5uTq17LvihAqurXgko8p/8mdGivtveZL/nDozx9S/+qrA687Sl3uA5Qk1Bwoxa5RVOq7rBeqnAm+y8g0dvIhHZYMoySh4WjevUW36Qs9DWZVbCbUqIN7qjHkf7nKhLya6mpvXXMqvnuze3jR8uH2C8ZMLsoiBPB8xZ/TIJR1T5BhUIJjy718hY6veC4oSkGwhSLDKJdQLoqlGBMITeI6/scg+htR3JVRJMFbYQAAAABJRU5ErkJggg==)" },
info: { "color": "#3AA7AD", "background-color": "#0C1C23", "border-color": "#112833", "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxMAAAsTAQCanBgAAASWSURBVFhH7VdNiBxFFH7VVT0/OzPrhqxu2NG4g6e4G9BcDGoOLuhJ9Ka3IJ5cjeySg8khQdGjqyBmE0EQL4ogeBPcCCookajgQYmnuLNI/tZE9n9npqu6/F5tr3ZP9+wfC4GwH1R3Tf28+ep7r6pe0y52cadBRO8tYeD9f/jFc7tQ+oQQJW6w1i6heQbVxfqre7hpy9gSodqZWTytwrTHSHhPCKkGSfp9aCy7ASBCJrhhjb5ENvwubC1/L6Sv66N3R90bY1OEamfmyJL1oMQh8tSo8AtHrAnu91Te9aOPH7AmYBC/TBB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ib9JVzSbyDL/EI352nuq/GoM4n2qf+h/9RFyleHNkzQ+KrQ0YHLN35i44BxLEEbF/nSW2Z2/QStI6E11M7GUljpbyOFtUhhV972eypnWzMzVB/bZgobRyzJfxirHRN+Hkm+vj1Jfhyrn0HEl93t/QxqR9uH4j1QzhHaiQ/FXeziDgPRvzoC8nK9ik5zAAAAAElFTkSuQmCC)" },
warn: { "color": "#D99853", "background-color": "#332B0B", "border-color": "#262008", "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxMAAAsTAQCanBgAAAOBSURBVFhH7VZLjwxRFP7Orep5ePQMQ7ySiRiPTCxkDIPEIyEkYjbSGcJMEBERjxDExs4PkHgMGzuJxB9AwgoLMdiRSBBLm1kg6JnuquM7VYXRUz2qe6u/zsntuo9zv/rOuecWGmiggf8NkrR1Q6+tsWY1bTrdPZNTIyXrqBcuaeuCDpOMwz60ercw3b8FDxeSobpRt0IRGaALOXcHTa4PIZ/K4SjK2C3Hnz+xwXpQv0KOS50bgkgPimRTDPh60kGP5/Ryb1Myq2bURUhv9lnTC1/2UOMcQo36o9aTLQxhIe6oHTUT0qu9QCloIZFBOOlGieooiSjbICLWzrGjDOncaEGNqImQnmkHPrwHct5aktlHRSRSpZkHrCVvM2JSnvTBc3v1Sk/NOVqbQkuXmuW56giTeT6K40BrHsGOiwgKV4BZnVSPp15kGm0IvrcsWZkZtRHyOd13m7jZAMaYxGEJml8A7VgBbVvGdglFKttpIyldx7kDOrzWT1ZnQmZCdGzhmM38OMuQtP5OZOaOqNVCqqUkaZXExhxbJwf4uCqalxHZFfK4gScFbrIV47ZxGiakzDhV8mQ5bUiH+zKXgUyE9AbVCXUR/56PT1TcPxkVAxY6EoJj+DIim0Kx/CdYd5ajXLGpmAtThiYe2wnjNtfJHObcab26piXpnRL/JJSo00PHh5I68wdGplSEOiPSzDB9Z1vhcowq+dKPJtmZ9EyJCUGfDD3YZY1gQ8dtEhqMQjARFj7Ph3ZthrbMhHv7iAS+cUWF2xxJBjpCxbbLyZHPSW8qplZofYdZP/NgR7R5JWzjoAR5cx/u1V3eZ18nkzFYNffErprDSU9VVCWk13mbB2Ge+hzj49xJ4TLYdeF8hOsPIdx2jtW6Le5LQ6i21ymmwOK4Ix2phFjySSYQlv8C32zj75pTiYC1p30RtLuAcOV+6LzuSLFUxBdvJ0N/Wq/3VhUifaCZxbXZX8hRHlnwbqhCyOWAL58gHx9CPtyDjL6LFEuFuQjVo+IDrOD2hZmKdEKWByKLGfMlfKP4OT76f5vPzcNxuCc34D24BPwYjfvS5kZG3zmZxe+oqtU7nZDdU2PBR/57xjcr8q14PyBINecCnrTYnJc+x4zBpJXp7zU/X17aNmkg7XQkH+8rOGMX324GHVXJVuKXlyqRjSD8KUmpPpaTL54mvQ000MD/DuAn3R4Ueh+VYR4AAAAASUVORK5CYII=)" }
}
});
(() => {
var div = document.querySelector('[data-lookup="viewer-container-toolbox"]');
var ele = `<div class="Styles__CardBody-dot39s-2 bar-wrapper view-card-body" style="display: none;">
<div class="container-bar">
<div
class="progress-wrapper topmargin mx-auto"
style="height: 20px; max-width: 600px"
>
<div
class="progress-bar progress-bar-striped progress-bar-animated bg-danger"
role="progressbar"
aria-valuenow="80"
aria-valuemin="0"
aria-valuemax="100"
style="width: 0%"
></div>
</div>
</div>
</div>`;
div.insertAdjacentHTML('beforeend', ele);
})();
});