1、打开https://www.browserscan.net/zh/
2、将internal-pdf-viewer改为 internal-pdf-viewer-jdtest看下效果:
3、源码修改:
third_party\blink\renderer\modules\plugins\dom_plugin_array.cc
namespace {
DOMPlugin* MakeFakePlugin(String plugin_name, LocalDOMWindow* window) {String description = "Portable Document Format";String filename = "internal-pdf-viewer-jdtest";auto* plugin_info =MakeGarbageCollected<PluginInfo>(plugin_name, filename, description,/*background_color=*/Color::kTransparent,/*may_use_external_handler=*/false);Vector<String> extensions{"pdf"};for (const char* mime_type : {"application/pdf", "text/pdf"}) {auto* mime_info = MakeGarbageCollected<MimeClassInfo>(mime_type, description, *plugin_info, extensions);plugin_info->AddMimeType(mime_info);}return MakeGarbageCollected<DOMPlugin>(window, *plugin_info);
}
} // namespace
修改下String filename = "internal-pdf-viewer-jdtest";名字即可。