| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /**
- * FeHelper Popup Menu
- */
- new Vue({
- el: '#pageContainer',
- data: {
- ajaxDebugger: '已开',
- canMeShow: {}
- },
- created: function () {
- let Settings = Tarp.require('../options/settings');
- // 根据配置,控制功能菜单的显示与隐藏
- Settings.getOptions((opts) => this.canMeShow = opts);
- // ajax debugger开关文案控制
- let bgPage = chrome.extension.getBackgroundPage();
- bgPage.BgPageInstance.tellMeAjaxDbgSwitch((dbgSwitchOn) => {
- this.ajaxDebugger = dbgSwitchOn ? '已开' : '已关';
- });
- },
- methods: {
- runHelper: function (mType, useFile) {
- // 获取后台页面,返回window对象
- let bgPage = chrome.extension.getBackgroundPage();
- if (mType === 'COLOR_PICKER') {
- bgPage.BgPageInstance.showColorPicker();
- } else {
- let MSG_TYPE = Tarp.require('../static/js/msg_type');
- bgPage.BgPageInstance.runHelper({
- msgType: MSG_TYPE[mType],
- useFile: useFile
- }, () => {
- if (mType === 'AJAX_DEBUGGER') {
- bgPage.BgPageInstance.tellMeAjaxDbgSwitch((dbgSwitchOn) => {
- this.ajaxDebugger = dbgSwitchOn ? '已开' : '已关';
- }, true);
- }
- });
- }
- window.close();
- },
- openOptionsPage: () => chrome.runtime.openOptionsPage()
- }
- });
|