diff --git a/icons/128.png b/icons/128.png new file mode 100644 index 0000000..433456f Binary files /dev/null and b/icons/128.png differ diff --git a/icons/16.png b/icons/16.png new file mode 100644 index 0000000..88f4a3f Binary files /dev/null and b/icons/16.png differ diff --git a/icons/48.png b/icons/48.png new file mode 100644 index 0000000..96af4c2 Binary files /dev/null and b/icons/48.png differ diff --git a/icons/original.psd b/icons/original.psd new file mode 100644 index 0000000..e62e961 Binary files /dev/null and b/icons/original.psd differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..06d3b41 --- /dev/null +++ b/manifest.json @@ -0,0 +1,27 @@ +{ + "manifest_version": 2, + "name": "Not yet, AV1", + "version": "1.0.0", + "description": "Extremely lightweight Chrome plugin to disable AV1 on YouTube and other sites.", + "icons": { + "16": "icons/16.png", + "48": "icons/48.png", + "128": "icons/128.png" + }, + "content_scripts": [ + { + "matches": [ + "*://*.youtube.com/*", + "*://*.youtube-nocookie.com/*", + "*://*.youtu.be/*" + ], + "js": [ + "src/inject/inject.js", + "src/inject/content_script.js" + ], + "run_at": "document_start", + "all_frames": true + } + ], + "homepage_url": "https://github.com/Shimmermare/NotYetAV1" +} \ No newline at end of file diff --git a/src/inject/content_script.js b/src/inject/content_script.js new file mode 100644 index 0000000..a2f8540 --- /dev/null +++ b/src/inject/content_script.js @@ -0,0 +1,37 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2015 erkserkserks + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// This content script runs in an isolated environment and cannot modify any +// javascript variables on the youtube page. Thus, we have to inject another +// script into the DOM. + +var injectScript = document.createElement('script'); +// Use textContent instead of src to run inject() synchronously +injectScript.textContent = inject.toString() + "inject();"; +injectScript.onload = function() { + // Remove