Google chrome extension Chrome扩展加载Roboto字体

Google chrome extension Chrome扩展加载Roboto字体,google-chrome-extension,font-face,Google Chrome Extension,Font Face,我有roboto字体,我需要把它放在分机里 在我的manifest.json文件中,我提到了可访问的web资源: "web_accessible_resources": ["fonts/*.ttf"] 下面是用于加载字体的css: @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: url('chrome-extension://__MSG_@@extension_id

我有roboto字体,我需要把它放在分机里

在我的manifest.json文件中,我提到了可访问的web资源:

"web_accessible_resources": ["fonts/*.ttf"]

下面是用于加载字体的css:

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src:  url('chrome-extension://__MSG_@@extension_id__/fonts/Roboto-Black.ttf') ;
}
/* latin */
@font-face {
  font-family: 'Roboto, sans-serif';
  font-style: normal;
  font-weight: 500;
  src:  url('chrome-extension://__MSG_@@extension_id__/fonts/Roboto-Medium.ttf');
}



/* latin */
@font-face {
  font-family: 'Roboto, sans-serif';
  font-style: normal;
  font-weight: 900;
  src: url('chrome-extension://__MSG_@@extension_id__/fonts/Roboto-Bold.ttf');
}
但我可以在加载扩展内容脚本css时不加载字体

1)尝试显式指定格式。2) 尝试下载其他类型,例如WOFF。3) 最后,请切换到数据URI。1)尝试显式指定格式。2) 尝试下载其他类型,例如WOFF。3) 最后,切换到数据URI。