Explorar o código

chrome: fixed ERR issue when saving pages with the ext. button in the editor

Gildas %!s(int64=5) %!d(string=hai) anos
pai
achega
9465a00ed9
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 3 1
      extension/core/bg/business.js
  2. 2 1
      extension/core/bg/editor.js

+ 3 - 1
extension/core/bg/business.js

@@ -28,6 +28,7 @@ singlefile.extension.core.bg.business = (() => {
 	const ERROR_CONNECTION_ERROR_CHROMIUM = "Could not establish connection. Receiving end does not exist.";
 	const ERROR_CONNECTION_LOST_CHROMIUM = "The message port closed before a response was received.";
 	const ERROR_CONNECTION_LOST_GECKO = "Message manager disconnected";
+	const ERROR_EDITOR_PAGE_CHROMIUM = "Cannot access contents of url ";
 	const INJECT_SCRIPTS_STEP = 1;
 	const EXECUTE_SCRIPTS_STEP = 2;
 	const TASK_PENDING_STATE = "pending";
@@ -224,7 +225,8 @@ singlefile.extension.core.bg.business = (() => {
 	function isIgnoredError(error) {
 		return error.message == ERROR_CONNECTION_LOST_CHROMIUM ||
 			error.message == ERROR_CONNECTION_ERROR_CHROMIUM ||
-			error.message == ERROR_CONNECTION_LOST_GECKO;
+			error.message == ERROR_CONNECTION_LOST_GECKO ||
+			error.message.startsWith(ERROR_EDITOR_PAGE_CHROMIUM + JSON.stringify(singlefile.extension.core.bg.editor.EDITOR_URL));
 	}
 
 	function cancelTab(tabId) {

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

@@ -35,7 +35,8 @@ singlefile.extension.core.bg.editor = (() => {
 		onMessage,
 		onTabRemoved,
 		isEditor,
-		open
+		open,
+		EDITOR_URL
 	};
 
 	async function open({ tabIndex, content, filename }, options) {