Pārlūkot izejas kodu

!2 fix file:/// and vtmsys

chenliangyu 4 mēneši atpakaļ
vecāks
revīzija
97e103e257

+ 3 - 3
Module/mod_chromium/CModTools.cpp

@@ -649,7 +649,7 @@ namespace Chromium {
 				if (startsWithHttpCaseInsensitive(url))
 				{
 					auto redirctUrlRet = getErrUrl(ERR_PAGE_REASON::redirect);
-					dstUrl = "\"" + redirctUrlRet.second + "?redirect_open=" + url + "&redirect_type=" + name + "\"";
+					dstUrl = "\"file:///" + redirctUrlRet.second + "?redirect_open=" + url + "&redirect_type=" + name + "\"";
 				}
 			}
 			strParams.Append(" --allow-running-insecure-content --disable-infobars --disable-suggestions-service --disable-save-password-bubble --disable-component-update");
@@ -684,7 +684,7 @@ namespace Chromium {
 				if (startsWithHttpCaseInsensitive(url))
 				{
 					auto redirctUrlRet = getErrUrl(ERR_PAGE_REASON::redirect);
-					dstUrl = "\"" + redirctUrlRet.second + "?redirect_open=" + url + "&redirect_type=" + name + "\"";
+					dstUrl = "\"file:///" + redirctUrlRet.second + "?redirect_open=" + url + "&redirect_type=" + name + "\"";
 				}
 			}
 			CSimpleStringA tempPath;
@@ -833,7 +833,7 @@ namespace Chromium {
 				if (startsWithHttpCaseInsensitive(url))
 				{
 					auto redirctUrlRet = getErrUrl(ERR_PAGE_REASON::redirect);
-					dstUrl = "\"" + redirctUrlRet.second + "?redirect_open=" + url + "&redirect_type=" + name + "\"";
+					dstUrl = "\"file:///" + redirctUrlRet.second + "?redirect_open=" + url + "&redirect_type=" + name + "\"";
 				}
 			}
 			if (pageType == 0 || pageType == 2 || pageType == 3) {

+ 5 - 5
addin/res/VTMModifyHeaders/background.js

@@ -89,11 +89,11 @@ class WebSocketLogger {
             messageType: 3080198,
             EntityName: 'header_log',
             ResultMsg: '',
-            LogType: 'Sys',
+            LogType: 'VTMSys',
             CostTime: 0,
-            ResultCode: '',
+            ResultCode: 'SUC0000',
             LogCode: '',
-            API: '',
+            API: 'header_log',
             SourceType: '',
             BussID: '',
             TipMsg: ''
@@ -227,7 +227,7 @@ function extractTypeFromFileProtocol(fileUrl) {
             return targetUrl;
         }
         else
-            return "unknown";
+            return "log";
     } catch (e) {
         console.error('Failed to parse file:// URL:', e);
     }
@@ -296,7 +296,7 @@ function loadConfigurationFromLocalStorage() {
             url: dstWs_logger,
             logging: true // 开启调试日志
         });
-        if (e.success) {
+        if (isSuc) {
             logger.log({
                 ResultMsg: "重载为:" + urlParam
             });