Del: Features plugin

This commit is contained in:
surunzi
2017-12-09 19:56:09 +08:00
parent 524cae61fc
commit f5703d263f
20 changed files with 524 additions and 7121 deletions

View File

@@ -59,6 +59,14 @@ export default [
},
desc: 'Display page fps'
},
{
name: 'Load Features Plugin',
fn()
{
loadPlugin('features');
},
desc: 'Browser feature detections'
},
{
name: 'Restore Settings',
fn()
@@ -139,7 +147,7 @@ function loadPlugin(name)
let globalName = 'eruda' + util.upperFirst(name);
if (window[globalName]) return;
util.loadJs('//cdn.jsdelivr.net/npm/eruda-' + name, (isLoaded) =>
util.loadJs(`//cdn.jsdelivr.net/npm/eruda-${name}@${pluginVersion[name]}`, isLoaded =>
{
if (!isLoaded || !window[globalName]) return logger.error('Fail to load plugin ' + name);
@@ -147,3 +155,8 @@ function loadPlugin(name)
emitter.emit(emitter.SHOW, name);
});
}
let pluginVersion = {
fps: '1.0.2',
features: '1.0.0'
};