微信小游戏获取document真机错误,微信开发者工具没问题

let wx = window[‘wx’];
var hackGlobal = window.__global;
if(!hackGlobal){
console.log(“hackGlobal fail”)
}
var document = hackGlobal.document
var innerWidth = window.innerWidth
var innerHeight = window.innerHeight
var canvas = document.getElementById(‘myCanvas’)
document在微信开发者工具里运行是正常的,但在手机端document为undefined