From 6b432a54a5638479edfe33100be1aefea2c1fcce Mon Sep 17 00:00:00 2001 From: FutureX Date: Thu, 12 Apr 2018 23:45:24 +0300 Subject: [PATCH] Version 1.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Исправлена проблема, что скрипт пытался запуститься, пока еще не загрузилась страница -Более менее работает -Добавил иконки в разных местах --- background.js | 2 +- injected.js | 6 ++++++ manifest.json | 42 ++++++++++++++++++++++++------------------ 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/background.js b/background.js index 68a151b..8bd0679 100644 --- a/background.js +++ b/background.js @@ -6,4 +6,4 @@ $.get(chrome.extension.getURL('/injected.js'), document.getElementsByTagName("head")[0].appendChild(script); document.getElementsByTagName("body")[0].setAttribute("onLoad", "injected_main();"); } -); \ No newline at end of file +); diff --git a/injected.js b/injected.js index e5bf15f..7fdd136 100644 --- a/injected.js +++ b/injected.js @@ -1,4 +1,10 @@ function injected_main() { + var timerId = setInterval(show, 2000); + setTimeout(function() { + clearInterval(timerId); + }, 7000); +} +function show() { $('*[class^="correct"]').show().removeClass("ng-hide").parent().show().removeClass("ng-hide"); $("table.ng-hide").removeClass("ng-hide"); $("section").css("user-select","initial"); diff --git a/manifest.json b/manifest.json index f87eba9..49f1300 100644 --- a/manifest.json +++ b/manifest.json @@ -1,20 +1,26 @@ { - "name": "LMS helper ♥", - "description": "Easy answers from your heart. Made with love by FutureX", - "version": "1.4.8.8", - "manifest_version": 2, - "browser_action": { - "default_icon": "icon.png" - }, - "content_scripts": [ - { - "matches": [ "*://www.cambridgelms.org/*" ], - "js": [ "jquery.js", "background.js" ], - "run_at": "document_end", - "all_frames": true - } - ], - "web_accessible_resources": [ - "/injected.js" - ] + "name": "LMS helper ♥", + "description": "Easy answers from your heart. Made with love by FutureX", + "icons": { + "16": "icon.png", + "32": "icon.png", + "48": "icon.png", + "128": "icon.png" + }, + "version": "1.4.8.8", + "manifest_version": 2, + "browser_action": { + "default_icon": "icon.png" + }, + "content_scripts": [ + { + "matches": [ "*://www.cambridgelms.org/*" ], + "js": [ "jquery.js", "background.js" ], + "run_at": "document_end", + "all_frames": true + } + ], + "web_accessible_resources": [ + "/injected.js" + ] } \ No newline at end of file