小编Gus*_*ira的帖子

"[仅报告]拒绝加载字体..."控制台上的错误消息

进一步来说:

[Report Only] Refused to load the font 'data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAABBQAAoAAAAAG…H8zVsjnmMx0GcZ2HGViNOySWEa9fvEQtW43Nm+EOO0ZIpdLbMXoVzPJkcfHT6U+gLEpz/MAAAA' because it violates the following Content Security Policy directive: "font-src 'self'".
Run Code Online (Sandbox Code Playgroud)

这是我的contentSecurityPolicy目标environment.js:

contentSecurityPolicy: {
  'default-src': "'none'",
  'script-src': "'self' 'unsafe-inline' 'unsafe-eval' connect.facebook.net",
  'connect-src': "'self'",
  'img-src': "'self' www.facebook.com",
  'style-src': "'self' 'unsafe-inline'",
  'frame-src': "s-static.ak.facebook.com static.ak.facebook.com www.facebook.com",
  'report-uri': "http://localhost:4200"
},
Run Code Online (Sandbox Code Playgroud)

有什么不对的吗?

javascript ember.js content-security-policy ember-cli

20
推荐指数
1
解决办法
1万
查看次数

是否可以每秒25次保存到浏览器localstorage?

我认为这个标题非常具有描述性.我正在使用Ember.js开展闲置游戏项目,现在我每秒节省25次本地存储,而不是每10或20秒保存一次.这是一个非常少量的数据,我没有遇到任何性能问题(至少在我的机器上),但我想知道这是不是很糟糕,如果是这样,那有多糟糕.谢谢 :)

javascript performance local-storage ember.js

5
推荐指数
1
解决办法
608
查看次数

找不到"应用程序"模板或视图.什么都不会被渲染Object {fullName:"template:application"}

我最近更新了ember-cli从项目0.0.440.1.1和所有的突然我的模板不装了,而是我得到的控制台上的以下警告:

Could not find "application" template or view. Nothing will be rendered Object {fullName: "template:application"}

Could not find "index" template or view. Nothing will be rendered Object {fullName: "template:index"}
Run Code Online (Sandbox Code Playgroud)

我用来更新项目的步骤只是:

npm install --save-dev ember-cli
ember init
Run Code Online (Sandbox Code Playgroud)

这是我的路由器:

import Ember from 'ember';
import config from './config/environment';

var Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
  this.route('login');
  this.route('permission');
  this.route('user');
  this.route('room');
  this.route('room/new');
});

Router.reopen({
  notifyGoogleAnalytics: function() {
    return window.ga('send', 'pageview', {
      'page': this.get('url'),
      'title': this.get('url')
    });
  }.on('didTransition') …
Run Code Online (Sandbox Code Playgroud)

javascript handlebars.js ember.js ember-cli

4
推荐指数
1
解决办法
1264
查看次数

未捕获错误:断言失败:尝试注册已使用的ID的视图:名称

Uncaught Error: Assertion Failed: Attempted to register a view with an id already in use: name使用ember-cli 随机开始在我的应用上出现此错误.我只有两条路线

Router.map(function() {
  this.route('buy');
  this.route('rent');
});
Run Code Online (Sandbox Code Playgroud)

没有控制器,我的索引路由重定向到我 buy

redirect: function() {
  this.transitionTo('buy');
}
Run Code Online (Sandbox Code Playgroud)

我的rent路线也渲染buy模板

renderTemplate: function() {
  this.render('buy');
}
Run Code Online (Sandbox Code Playgroud)

我没有rentindex模板.我不知道这个错误来自哪里.

javascript ember.js ember-cli

2
推荐指数
1
解决办法
3070
查看次数