Skip to content

Commit

Permalink
implement webpack and create scripts to bundle source
Browse files Browse the repository at this point in the history
  • Loading branch information
leonbubova committed Dec 15, 2021
1 parent e39b52e commit 7b9c178
Show file tree
Hide file tree
Showing 11 changed files with 3,743 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ yarn-error.log*
*.ntvs*
*.njsproj
*.sln
*.sw*
*.sw*

node_modules
1 change: 0 additions & 1 deletion Extensions/combined/init/init.js
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
RYD.getInstance().init();
5 changes: 3 additions & 2 deletions Extensions/combined/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
"*://m.youtube.com/*"
],
"exclude_matches": ["*://*.music.youtube.com/*"],
"js": ["ryd.content-script.js", "ryd.tools.js", "/init/init.js"],
"css": ["content-style.css"]
"run_at": "document_idle",
"css": ["content-style.css"],
"js": ["bundled-content-script.js"]
}
],
"externally_connectable": {
Expand Down
2 changes: 1 addition & 1 deletion Extensions/combined/manifestv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"exclude_matches": ["*://*.music.youtube.com/*"],
"run_at": "document_idle",
"css": ["content-style.css"],
"js": ["ryd.content-script.js", "ryd.tools.js", "/init/init.js"]
"js": ["bundled-content-script.js"]
}
]

Expand Down
18 changes: 18 additions & 0 deletions Extensions/combined/ryd.content-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,21 @@ RYD.getInstance = function () {
if (typeof RYD.instance == "undefined") RYD.instance = new RYD();
return RYD.instance;
};

RYDTools = {};

RYDTools.getBrowser = function () {
if (typeof chrome !== "undefined" && typeof chrome.runtime !== "undefined") {
return chrome;
} else if (
typeof browser !== "undefined" &&
typeof browser.runtime !== "undefined"
) {
return browser;
} else {
console.log("browser is not supported");
return false;
}
};

RYD.getInstance().init();
15 changes: 0 additions & 15 deletions Extensions/combined/ryd.tools.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
RYDTools = {};

RYDTools.getBrowser = function () {
if (typeof chrome !== "undefined" && typeof chrome.runtime !== "undefined") {
return chrome;
} else if (
typeof browser !== "undefined" &&
typeof browser.runtime !== "undefined"
) {
return browser;
} else {
console.log("browser is not supported");
return false;
}
};


Loading

0 comments on commit 7b9c178

Please sign in to comment.