处理长短链接

This commit is contained in:
许彦峰
2019-03-16 18:44:32 +08:00
parent 805d7e15fb
commit a8a26154f8
6 changed files with 64 additions and 72 deletions

View File

@@ -1,32 +1,10 @@
// 检查游戏是否为cocos游戏
// var cc={};
// if (typeof cc === "undefined") {
// console.log("该html不是cocos游戏,无法调试!");
// chrome.devtools.panels.elements.createSidebarPane("Creator Properties", function (sidebar) {
// // console.log("[Cocos Creator Inspector] CreateSidebarPane");
// // sidebar.setObject({ some_data: "Some data to show" });
// sidebar.setPage("devNoGame.html");
// });
// chrome.devtools.panels.create(
// "Cocos",
// "static/images/icon48.png",
// "devNoGame.html", function (panel) {
// // console.log("[Cocos Creator Inspector] Dev Panel Created!");
// });
//
// } else {
//
// }
// chrome.devtools.panels.elements.createSidebarPane('My SliderBar', function (sidebar) {
// sidebar.setObject({some_data: "some data to show!"});
// });
chrome.devtools.panels.create("Cocos", "icon/icon48.png", "pages/devtools_panel.html",
function (panel) {
console.log("[Cocos Creator Inspector] Dev Panel Created!");
// 对应的是Elements面板的边栏
chrome.devtools.panels.elements.createSidebarPane('Cocos', function (sidebar) {
sidebar.setObject({some_data: "some data to show!"});
});
// 创建devtools-panel
chrome.devtools.panels.create("Cocos", "icon/icon48.png", "pages/devtools_panel.html", function (panel) {
console.log("[CC-Inspector] Dev Panel Created!");
panel.onShown.addListener(function (window) {
console.log("panel show");
});

View File

@@ -43,14 +43,8 @@
}
},
created() {
if (chrome && chrome.extension) {
} else {
this.isShowDebug = true;
this.onTestData();
return;
}
let backgroundPageConnection = chrome.extension.connect({
debugger
let backgroundPageConnection = chrome.runtime.connect({
name: btoa("for" + String(chrome.devtools.inspectedWindow.tabId))
});
backgroundPageConnection.onMessage.addListener(function (message) {
@@ -183,6 +177,7 @@
},
onBtnClickUpdatePage() {
debugger
let code = this._getInjectScriptString();
chrome.devtools.inspectedWindow.eval(code, function () {
console.log("刷新成功!");