Click here to Skip to main content
15,885,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
First of all, I use Chromium browser, not Google Chrome.

But the problem is when I click the button of my extension, I get
"Specified native messaging host not found."
error.

Here is my com.cagatay.chromium.updater.json file:

JSON
{
    "name"              : "com.cagatay.chromium.updater",
    "description"       : "Bu eklenti, Chromium'un g\u{FC}ncelle\u{15F}tirmelerini denetler ve y\u{FC}kler.",
    "path"              : "D:\\deneme.exe",
    "type"              : "stdio",
    "allowed_origins"   :
    [
        "chrome-extension://alahmndbpjaieilooflfaikkoghmboll/"
    ]
}


Here is my background.js file:

JavaScript
var sonuc = null;

function fnMesajiAl(alinanMesaj)
{
    sonuc = JSON.stringify(alinanMesaj);
}

document.addEventListener
(
    'DOMContentLoaded',
    function()
    {
        var guncellestirmeleriDenetlemeDugmesi = document.getElementById('Image2');
        
        guncellestirmeleriDenetlemeDugmesi.addEventListener
        (
            'click',
            function()
            {
                window.close();
                
                var uygulamayaBaglan = chrome.runtime.connectNative("com.cagatay.chromium.updater");
                uygulamayaBaglan.postMessage('guncellestirmeleriDenetle');
                
                uygulamayaBaglan.onMessage.addListener(fnMesajiAl);
                
                if(sonuc === 'yok')
                {
                    alert('En güncel sürümü kullanıyorsunuz!');
                }
            }
        );
    }
);


What I have tried:

And my json file is located at: <pre>"D:\Chromium Güncelleştirici Eklenti Projesi\Data\com.cagatay.chromium.updater.json"


I have added this json path to almost everywhere in regedit.

But I still get this error.

So, what should I do?
Posted

1 solution

Have you tried making registry entries as stated in below article ?

HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.cagatay.chromium.updater 
or HKEY_CURRENT_USER\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.cagatay.chromium.updater


In the default, set the path of your manifest file.

Native Messaging - Chrome Developers[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900