Ver Fonte

made the button looking disabled during the initialization phase

Gildas há 7 anos atrás
pai
commit
eb5bdbd504

+ 2 - 1
extension/core/bg/processor.js

@@ -47,8 +47,9 @@ singlefile.processor = (() => {
 		options.onprogress = async event => {
 			if (event.type == event.RESOURCES_INITIALIZED) {
 				maxIndex = event.details.max;
+				singlefile.ui.button.onProgress(tabId, index, maxIndex, { autoSave: true });
 			}
-			if (event.type == event.RESOURCES_INITIALIZED || event.type == event.RESOURCE_LOADED) {
+			if (event.type == event.RESOURCE_LOADED) {
 				index++;
 				singlefile.ui.button.onProgress(tabId, index, maxIndex, { autoSave: true });
 			} else if (event.type == event.PAGE_ENDED) {

+ 3 - 1
extension/core/content/content.js

@@ -73,7 +73,9 @@ this.singlefile.top = this.singlefile.top || (() => {
 				maxIndex = event.details.max;
 			}
 			if (event.type == event.RESOURCES_INITIALIZED || event.type == event.RESOURCE_LOADED) {
-				index++;
+				if (event.type == event.RESOURCE_LOADED) {
+					index++;
+				}
 				browser.runtime.sendMessage({ processProgress: true, index, maxIndex, options: { autoSave: false } });
 				if (options.shadowEnabled) {
 					singlefile.ui.onprogress(index, maxIndex);

+ 1 - 1
extension/ui/bg/ui-button.js

@@ -106,7 +106,7 @@ singlefile.ui.button = (() => {
 	}
 
 	function onInitialize(tabId, options, step) {
-		refresh(tabId, getProperties(tabId, options, browser.i18n.getMessage("buttonInitializingBadge"), step == 1 ? DEFAULT_COLOR : [4, 229, 36, 255], browser.i18n.getMessage("buttonInitializingTooltip") + " (" + step + "/2)"));
+		refresh(tabId, getProperties(tabId, options, browser.i18n.getMessage("buttonInitializingBadge"), step == 1 ? DEFAULT_COLOR : [4, 229, 36, 255], browser.i18n.getMessage("buttonInitializingTooltip") + " (" + step + "/2)", WAIT_ICON_PATH_PREFIX + "0.png"));
 	}
 
 	function onError(tabId, options) {