mirror of
https://github.com/liriliri/eruda.git
synced 2026-04-01 10:18:35 +08:00
Del: Features plugin
This commit is contained in:
@@ -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'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user