Welcome guest, is this your first visit? Create Account now to join.
Results 1 to 7 of 7

This is a discussion on How to debug content script? within the Plugins Development section, part of the Chrome Plugins category: Hi, could you please explain me how to debug Chrome extension's content script?? I'm developing a 'content script' extension and ...


  1. #1
    alex82 is offline Junior Member
    Join Date
    Dec 2009
    Posts
    6

    Default How to debug content script?

    Hi,
    could you please explain me how to debug Chrome extension's content script??

    I'm developing a 'content script' extension and I'm launching chrome with --load-extension parameter.

    I need to set breakpoints and step/run through my script as it executes.

    I have managed to debug script code contained in background page of my extension, but I do not know how to debug code contained in my script file.

    Could you please describe the steps to take to debug content script using Developer Tools? Is there other debuggers for Chrome besides Developer Tools?


    Thanks in advance!

  2. #2
    PAEz's Avatar
    PAEz is offline Moderator
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    656

    Default

    I dont debug much but I know the content scripts are part of the page their attached to and you can use the Developer Tools that way....bring up the Developer Tools for the page and your content script will be under scripts.

  3. #3
    alex82 is offline Junior Member
    Join Date
    Dec 2009
    Posts
    6

    Default

    Thanks for your replay, PAEz, but my script is not present in Development Tools under Scripts. I see other scripts there, not main. So this is exactly my problem - I can not access my script for debugging.

    Even though I have inserted allowBreakpoints=true; and debugger; statments into my script code and have Developers Tools opened...

    But my script do its work. Is it possible to debug it?

    Any ideas?

  4. #4
    Skymt is offline Junior Member
    Join Date
    Nov 2009
    Posts
    20

    Default

    Sounds to me that there is something wrong with your manifest.json file.

    Check for spelling errors, or try using more lenient wildcards...

  5. #5
    tubgirl is offline Member
    Join Date
    Oct 2009
    Location
    turkey,istanbul
    Posts
    31

    Default Having the same problem

    I'm injecting a content script into a page, the code works, but the list of scripts in the debugger does not have my script.

    Does anyone know how to make the chrome debugger show my content scripts?

  6. #6
    paul kuo is offline Junior Member
    Join Date
    Sep 2010
    Posts
    1

    Default

    http://stackoverflow.com/questions/1...-google-chrome
    This link might help. I have the same problem as you and find it might be helpful. Though I didn't get it done yet.

  7. #7
    khuevu is offline Junior Member
    Join Date
    Jul 2012
    Posts
    1

    Default

    Quote Originally Posted by alex82 View Post
    Thanks for your replay, PAEz, but my script is not present in Development Tools under Scripts. I see other scripts there, not main. So this is exactly my problem - I can not access my script for debugging.

    Even though I have inserted allowBreakpoints=true; and debugger; statments into my script code and have Developers Tools opened...

    But my script do its work. Is it possible to debug it?

    Any ideas?
    Hi,
    You can debug the content script by open the Developer Tools -> Script -> Content scripts -> (program) file. it is the script file you inserted using executeScript(scriptfile.js)
    Hope it help.

Similar Threads

  1. Content Script Issues
    By hexid in forum Plugins Development
    Replies: 2
    Last Post: 12-15-2009, 03:37 PM
  2. Stuck with content script...
    By rohit in forum Plugins Development
    Replies: 1
    Last Post: 12-15-2009, 03:19 PM
  3. Toolstrips like Content Scripts???
    By HOLYCOWBATMAN in forum Plugins Development
    Replies: 2
    Last Post: 08-17-2009, 04:18 PM
  4. Chrome content scripts
    By mack in forum Plugins Development
    Replies: 2
    Last Post: 08-15-2009, 10:29 AM
  5. content script problem..
    By Gaurang033 in forum Chrome Plugins
    Replies: 0
    Last Post: 06-01-2009, 10:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •