Using native messaging within Selenium ChromeDriver?












3















I'm working on a chrome extension that uses native messaging. Native messaging works great on my personal copy of Chrome, but I get error messages from the extension when using it in selenium via ChromeDriver:



Error in event handler for runtime.onMessage: Error: Attempting to use a disconnected port object


I'm loading the extension via the following protractor config:



capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': [
'--load-extension=./build/chrome'
]
},
}


Does one have to do something special to enable native messaging in ChromeDriver? I've tried adding our native messaging manifest file(s) to the global locations for both Chrome and Chromium, but still no luck.










share|improve this question























  • Does it have the same id? To ensure it, add a "key" in manifest.json

    – wOxxOm
    Dec 17 '17 at 3:45











  • @wOxxOm yes, we already have a static key in the manifest.

    – kjb
    Dec 17 '17 at 4:00






  • 1





    @georgexsh Unfortunately not. We just had to give up testing on Chrome. It appears ChromeDriver, at least last time we checked, simply doesn't support native messaging.

    – kjb
    Nov 17 '18 at 16:33






  • 1





    @georgexsh just verified native messaging does work with chrome driver using selenium. are you getting the same error msg as in the question?

    – Riwaz Poudyal
    Nov 19 '18 at 23:25






  • 1





    @RiwazPoudyal yes it actually works, good news! I must do something wrong the other day.

    – georgexsh
    Nov 20 '18 at 6:20
















3















I'm working on a chrome extension that uses native messaging. Native messaging works great on my personal copy of Chrome, but I get error messages from the extension when using it in selenium via ChromeDriver:



Error in event handler for runtime.onMessage: Error: Attempting to use a disconnected port object


I'm loading the extension via the following protractor config:



capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': [
'--load-extension=./build/chrome'
]
},
}


Does one have to do something special to enable native messaging in ChromeDriver? I've tried adding our native messaging manifest file(s) to the global locations for both Chrome and Chromium, but still no luck.










share|improve this question























  • Does it have the same id? To ensure it, add a "key" in manifest.json

    – wOxxOm
    Dec 17 '17 at 3:45











  • @wOxxOm yes, we already have a static key in the manifest.

    – kjb
    Dec 17 '17 at 4:00






  • 1





    @georgexsh Unfortunately not. We just had to give up testing on Chrome. It appears ChromeDriver, at least last time we checked, simply doesn't support native messaging.

    – kjb
    Nov 17 '18 at 16:33






  • 1





    @georgexsh just verified native messaging does work with chrome driver using selenium. are you getting the same error msg as in the question?

    – Riwaz Poudyal
    Nov 19 '18 at 23:25






  • 1





    @RiwazPoudyal yes it actually works, good news! I must do something wrong the other day.

    – georgexsh
    Nov 20 '18 at 6:20














3












3








3








I'm working on a chrome extension that uses native messaging. Native messaging works great on my personal copy of Chrome, but I get error messages from the extension when using it in selenium via ChromeDriver:



Error in event handler for runtime.onMessage: Error: Attempting to use a disconnected port object


I'm loading the extension via the following protractor config:



capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': [
'--load-extension=./build/chrome'
]
},
}


Does one have to do something special to enable native messaging in ChromeDriver? I've tried adding our native messaging manifest file(s) to the global locations for both Chrome and Chromium, but still no luck.










share|improve this question














I'm working on a chrome extension that uses native messaging. Native messaging works great on my personal copy of Chrome, but I get error messages from the extension when using it in selenium via ChromeDriver:



Error in event handler for runtime.onMessage: Error: Attempting to use a disconnected port object


I'm loading the extension via the following protractor config:



capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': [
'--load-extension=./build/chrome'
]
},
}


Does one have to do something special to enable native messaging in ChromeDriver? I've tried adding our native messaging manifest file(s) to the global locations for both Chrome and Chromium, but still no luck.







google-chrome selenium google-chrome-extension selenium-chromedriver chrome-native-messaging






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 17 '17 at 2:07









kjbkjb

1,58531527




1,58531527













  • Does it have the same id? To ensure it, add a "key" in manifest.json

    – wOxxOm
    Dec 17 '17 at 3:45











  • @wOxxOm yes, we already have a static key in the manifest.

    – kjb
    Dec 17 '17 at 4:00






  • 1





    @georgexsh Unfortunately not. We just had to give up testing on Chrome. It appears ChromeDriver, at least last time we checked, simply doesn't support native messaging.

    – kjb
    Nov 17 '18 at 16:33






  • 1





    @georgexsh just verified native messaging does work with chrome driver using selenium. are you getting the same error msg as in the question?

    – Riwaz Poudyal
    Nov 19 '18 at 23:25






  • 1





    @RiwazPoudyal yes it actually works, good news! I must do something wrong the other day.

    – georgexsh
    Nov 20 '18 at 6:20



















  • Does it have the same id? To ensure it, add a "key" in manifest.json

    – wOxxOm
    Dec 17 '17 at 3:45











  • @wOxxOm yes, we already have a static key in the manifest.

    – kjb
    Dec 17 '17 at 4:00






  • 1





    @georgexsh Unfortunately not. We just had to give up testing on Chrome. It appears ChromeDriver, at least last time we checked, simply doesn't support native messaging.

    – kjb
    Nov 17 '18 at 16:33






  • 1





    @georgexsh just verified native messaging does work with chrome driver using selenium. are you getting the same error msg as in the question?

    – Riwaz Poudyal
    Nov 19 '18 at 23:25






  • 1





    @RiwazPoudyal yes it actually works, good news! I must do something wrong the other day.

    – georgexsh
    Nov 20 '18 at 6:20

















Does it have the same id? To ensure it, add a "key" in manifest.json

– wOxxOm
Dec 17 '17 at 3:45





Does it have the same id? To ensure it, add a "key" in manifest.json

– wOxxOm
Dec 17 '17 at 3:45













@wOxxOm yes, we already have a static key in the manifest.

– kjb
Dec 17 '17 at 4:00





@wOxxOm yes, we already have a static key in the manifest.

– kjb
Dec 17 '17 at 4:00




1




1





@georgexsh Unfortunately not. We just had to give up testing on Chrome. It appears ChromeDriver, at least last time we checked, simply doesn't support native messaging.

– kjb
Nov 17 '18 at 16:33





@georgexsh Unfortunately not. We just had to give up testing on Chrome. It appears ChromeDriver, at least last time we checked, simply doesn't support native messaging.

– kjb
Nov 17 '18 at 16:33




1




1





@georgexsh just verified native messaging does work with chrome driver using selenium. are you getting the same error msg as in the question?

– Riwaz Poudyal
Nov 19 '18 at 23:25





@georgexsh just verified native messaging does work with chrome driver using selenium. are you getting the same error msg as in the question?

– Riwaz Poudyal
Nov 19 '18 at 23:25




1




1





@RiwazPoudyal yes it actually works, good news! I must do something wrong the other day.

– georgexsh
Nov 20 '18 at 6:20





@RiwazPoudyal yes it actually works, good news! I must do something wrong the other day.

– georgexsh
Nov 20 '18 at 6:20












1 Answer
1






active

oldest

votes


















1














as of 2018.11, with Chrome 70 and chromedriver 2.43, native messaging works well.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47851635%2fusing-native-messaging-within-selenium-chromedriver%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    as of 2018.11, with Chrome 70 and chromedriver 2.43, native messaging works well.






    share|improve this answer




























      1














      as of 2018.11, with Chrome 70 and chromedriver 2.43, native messaging works well.






      share|improve this answer


























        1












        1








        1







        as of 2018.11, with Chrome 70 and chromedriver 2.43, native messaging works well.






        share|improve this answer













        as of 2018.11, with Chrome 70 and chromedriver 2.43, native messaging works well.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 20 '18 at 6:22









        georgexshgeorgexsh

        10.5k11337




        10.5k11337
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47851635%2fusing-native-messaging-within-selenium-chromedriver%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Xamarin.form Move up view when keyboard appear

            Post-Redirect-Get with Spring WebFlux and Thymeleaf

            Anylogic : not able to use stopDelay()