4

正如您在Chromium 项目中看到的那样,Chrome/Chromium 很快将不支持 NPAPI。所以你可以开发基于 PPAPI 的解决方案,好的。

我开发了一个使用 NPAPI 插件的门户网站。每次加载门户(也许更新 chrome)时,我都需要知道客户端浏览器是否保持兼容(即支持 NPAPI)。

换句话说,我会这样:

// sub-methods
function isTheBrowserNpapiCapable() {
    // something I am searching
}

function displayTheNewPortal() {
    // install the PPAPI plugin if not present
    // do something ...
}

function displayTheRegularPortal() {
    // install the NPAPI plugin if not present
    // do something ...
}

// main code
if(isTheBrowserNpapiCapable()) {
    console.log("The browser stays compatible with the regular NPAPI plugin!");
    displayTheRegularPortal();

} else {
    console.log("Got it! NPAPI is definitively discarded. User must install the new PPAPI plugin");
    displayTheNewPortal();
}

我发现“检测 chrome 用户是否激活了 NPAPI”“NPAPI 未在 Chrome 中加载”“使用 Javascript 检测 NPAPI”,但这对我没有帮助。我没有兴趣知道我的插件是否已安装,但什么是正确的安装(NPAPI 或 PPAPI)。

有人有想法可以帮助我吗?

问候

4

0 回答 0