过去可以使用JavaScript 中的对象访问http://web.whatsapp.com/ 。Store
几个小时前,这停止了工作。它现在如何更新聊天数据?它必须将数据保存在某处。
问问题
2914 次
3 回答
6
我正在使用它再次获取商店:
setTimeout(function() {
// Returns promise that resolves to all installed modules
function getAllModules() {
return new Promise((resolve) => {
const id = _.uniqueId("fakeModule_");
window["webpackJsonp"](
[],
{
[id]: function(module, exports, __webpack_require__) {
resolve(__webpack_require__.c);
}
},
[id]
);
});
}
var modules = getAllModules()._value;
// Automatically locate modules
for (var key in modules) {
if (modules[key].exports) {
if (modules[key].exports.default) {
if (modules[key].exports.default.Wap) {
store_id = modules[key].id.replace(/"/g, '"');
}
}
}
}
}, 5000);
function _requireById(id) {
return webpackJsonp([], null, [id]);
}
// Module IDs
var store_id = 0;
var Store = {};
function init() {
Store = _requireById(store_id).default;
console.log("Store is ready" + Store);
}
setTimeout(function() {
init();
}, 7000);
只需在控制台上复制和粘贴,然后等待消息“存储已准备好”。享受!
于 2018-05-28T19:53:34.037 回答
4
为了详细解释 Pablo 的答案,最初我们使用基于此的代码加载所有 Webpack 模块我如何使用 webpack 从控制台中 require()?.
本质上,它getAllModules()
返回一个带有 Webpack 中所有已安装模块的承诺。每个模块都可以使用Webpack 公开_requireById(id)
的功能按 ID 要求。webpackJsonp(...)
加载模块后,我们需要确定哪个id对应于 Store。我们搜索一个包含exports.default.Wap的模块并将它的id指定为Store ID。
您可以在我的 github wiki 上找到更多详细信息
于 2018-06-21T06:07:56.243 回答
0
一种更快的方法:我抓住“应用程序”的来源,然后找到商店对象
我将它保存在 ZStore 全局变量中。:D
!function(){for(var t of document.getElementsByTagName("script"))t.src.indexOf("/app.")>0&&fetch(t.src,{method:"get"}).then(function(t){return t.text().then(function(t){var e=t.indexOf('var a={};t["default"]')-89;window.ZStore=window.webpackJsonp([],null,JSON.stringify(t.substr(e,10))).default})})}();
window.ZStore 将包含该对象。
非缩小版:
(function() {
function getStore(url) {
fetch(url, {
"method": 'get'
}).then(function(response) {
return response.text().then(function(data) {
var offset = data.indexOf('var a={};t["default"]') - 89;
window.ZStore = window.webpackJsonp([], null, JSON.stringify(data.substr(offset, 10))).default
});
});
}
for (var e of document.getElementsByTagName("script")) {
if (e.src.indexOf("/app.") > 0) getStore(e.src);
}
})();
于 2019-02-18T07:59:56.953 回答