uweb updates to 1056

master
James Feng Cao 3 months ago
parent 5c2b79c14b
commit a46482ada7

@ -1,7 +1,7 @@
<script>var verCode = %1%;</script>
<script>
(function(){
let latestV = 1055;
let latestV = 1056;
try {
if(verCode>=latestV) {alert("Already up to date!");return;}
}catch(e){}

@ -605,10 +605,14 @@ You should have received a copy of the GNU General Public License along with thi
rurl = url.substring(4);
data = [];
}
break;
}
case 50: //i:p2[url]#[filePath] post request with local file
rurl = url.substring(4,iQ);
data = [{type: 'file', filePath:url.substring(iQ+1)}];
break;
default:
return;
}
tabs.children[iTab].loadURL(rurl,{postData:data,extraHeaders:'Content-Type: application/x-www-form-urlencoded'});
return;

@ -15,7 +15,7 @@
"brave":"https://search.brave.com/search?q=%s",
"g":"https://google.com/search?q=%s",
"git":"https://github.com/search?type=Repositories&q=%s",
"360":"https://so.360.com/s?q=%s",
"360":"https://so.360.com?q=%s",
"tg":"https://www.tiangong.cn/result?q=%s",
"cg":"i:0/js/s2ta.js:https://chatglm.cn/main/detail?%s",
"bdc":"i:0/js/s2editable.js:https://chat.baidu.com/?%s",

@ -727,3 +727,27 @@ function promiseContextMenu(menuTemplate) {
menu.popup();
});
}
function httpReq(url, method, filePath){
fs.readFile(filePath, (err, fileData) => {
if (err) {
console.error(`Error reading file: ${err.message}`);
return;
}
// Create a new net request
const request = net.request({
method: method,
url: url,
session: session.defaultSession, // Use the session to include cookies
});
// Set the Content-Type header
request.setHeader('Content-Type', 'application/octet-stream');
request.on('error', (error) => {
console.error(`ERROR: ${error.message}`);
});
request.write(fileData);
request.end();
});
}

Loading…
Cancel
Save