Skip to content
This repository was archived by the owner on Jan 6, 2021. It is now read-only.
This repository was archived by the owner on Jan 6, 2021. It is now read-only.

Init function is not invoked #1

Open

Description

@StanislavMayorov

Hi.
I'm trying to use this extension, but 'run in browser' button doesn't appear. I noticed that init function is not invoked because event handler in background.js doesn't work properly.

Activity

  1. changed the title [-]Init method is not invoked[/-] [+]Init function is not invoked[/+] on Mar 4, 2017
  2. bojan88 commented on Mar 4, 2017

    @bojan88
    Owner

    Hi, thanks for the info. Can to please tell me which browser are you using?

  3. StanislavMayorov commented on Mar 5, 2017

    @StanislavMayorov
    Author

    I'm using chrome ver. 56 (in ver. 59 I see the same behaviour).
    It works fine if I delete the second condition in if in background.js. But I don' think that it's good solution.

     // if (port.name === "devtools-page" && port.sender.tab.title.match(/Developer Tools.*https?:\/\/(www.)?codewars.com\/kata\/.+\/javascript/)) 
      if (port.name === "devtools-page") 
    

    Error in console says that title is undefined.

  4. bojan88 commented on Mar 5, 2017

    @bojan88
    Owner

    Can you please try now? I guess the listener caught a message from other source, not from this extension which broke it because .tab property is optional and maybe not sent in other messages. It should be present in the message sent from this extension from Chrome developer tools

  5. StanislavMayorov commented on Mar 5, 2017

    @StanislavMayorov
    Author

    No, It still doesn't work.
    I have only this property in post.sender object:
    id: "cbknhbpodbomcgnhgiblflfjjglcnicc",
    url: "chrome-extension://cbknhbpodbomcgnhgiblflfjjglcnicc/src/devtools/index.html"

  6. bojan88 commented on Mar 5, 2017

    @bojan88
    Owner

    I completely changed the way tab URL is checked. Please try now

  7. StanislavMayorov commented on Mar 5, 2017

    @StanislavMayorov
    Author

    @bojan88 It works! Thanks for your extension.

  8. bojan88 commented on Mar 5, 2017

    @bojan88
    Owner

    Great. I'm glad it's useful.

  9. StanislavMayorov commented on Mar 5, 2017

    @StanislavMayorov
    Author

    @bojan88 Unfortunately in the newest chrome canary (ver. 59) It still doesn't work. I don't know what exactly is a reason.
    In chrome ver. 56 It works fine.

  10. reopened this on Mar 5, 2017
  11. bojan88 commented on Mar 7, 2017

    @bojan88
    Owner

    @StanislavMayorov I just checked, and it's working in Chrome Canary 59.0.3032.0. Try reloading the extension

  12. StanislavMayorov commented on Mar 8, 2017

    @StanislavMayorov
    Author

    @bojan88 I try to reload one more time and It's working in my Chrome Canary 59.0.3033.0.
    I can't give more information. I found out only that messageHanler wasn't invoked, but it was added successfully here port.onMessage.addListener(messageHanler);

          var messageHanler = function(message, sender) {
            debugger;
            if (message.action === "init") {
         
              tabId = message.tabId;
              chrome.tabs.sendMessage(tabId, {
                action: 'init',
                source: 'cw-dev-tools-msg'
              });
            }
          };
    

    Chrome shows some errores.
    image
    If this information isn't enough you can close my issue. I'm glad that it works fine in ver. 56. Thank you for support.

  13. added a commit that references this issue on Mar 10, 2017
  14. bojan88 commented on Mar 10, 2017

    @bojan88
    Owner

    @StanislavMayorov can you try now?

  15. StanislavMayorov commented on Mar 27, 2017

    @StanislavMayorov
    Author

    @bojan88 I have noticed that It works with some taskes and doesn't work with others. It still doesn't work with this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions