Browse Source

fix(injected): fix polyfills for injected-web

Gerald 8 năm trước cách đây
mục cha
commit
4230391acb

+ 1 - 0
src/background/app.js

@@ -1,3 +1,4 @@
+import 'src/common/polyfills';
 import 'src/common/browser';
 import { i18n, defaultImage } from 'src/common';
 import * as sync from './sync';

+ 0 - 2
src/common/browser.js

@@ -1,5 +1,3 @@
-import './polyfills';
-
 /* global chrome */
 const global = window;
 

+ 1 - 0
src/confirm/app.js

@@ -1,4 +1,5 @@
 import Vue from 'vue';
+import 'src/common/polyfills';
 import 'src/common/browser';
 import { i18n } from 'src/common';
 import 'src/common/handlers';

+ 1 - 0
src/injected/utils.js

@@ -1,4 +1,5 @@
 export { sendMessage, request } from 'src/common';
+export Promise from 'core-js/library/fn/promise';
 
 export function postData(destId, data) {
   // Firefox issue: data must be stringified to avoid cross-origin problem

+ 2 - 0
src/injected/web/helpers.js

@@ -1,3 +1,5 @@
+import { Promise } from '../utils';
+
 const arrayProto = Array.prototype;
 
 const bindThis = func => (thisObj, ...args) => func.apply(thisObj, args);

+ 1 - 1
src/injected/web/index.js

@@ -1,4 +1,4 @@
-import { getUniqId, bindEvents } from '../utils';
+import { getUniqId, bindEvents, Promise } from '../utils';
 import { includes, forEach, map, utf8decode } from './helpers';
 import bridge from './bridge';
 import { onRequestCreate, onRequestStart, onRequestCallback } from './requests';

+ 1 - 0
src/options/app.js

@@ -1,4 +1,5 @@
 import Vue from 'vue';
+import 'src/common/polyfills';
 import 'src/common/browser';
 import 'src/common/sprite';
 import { sendMessage, i18n, getLocaleString } from 'src/common';

+ 1 - 0
src/popup/app.js

@@ -1,4 +1,5 @@
 import Vue from 'vue';
+import 'src/common/polyfills';
 import 'src/common/browser';
 import 'src/common/sprite';
 import { i18n, sendMessage } from 'src/common';