Console doesn't log js errors from content script











up vote
3
down vote

favorite
1












I know that to debug content script use normal web developer tools (https://developer.mozilla.org/en/docs/Mozilla/Add-ons/WebExtensions/Debugging#Debugging_content_scripts), and this works perfect. debugger keyword works as intended.



But in this exact situation things get broken:



addon.id = "123-568-485"; // I never define `addon` before this line, so this cause: ReferenceError: "addon is not defined". We aren't aware of this mistake.

// Some more code
// Some more code
// Some more code
// Some more code

debugger; // Here we want to stop execution and inspect, some other stuff. Remember that we aren't aware of earlier mistake.


What we would expect, that in console error about Reference error will appear, but it doesn't. Console get silent, and we don't know why our debugger keyword doesn't work.



This kind of silent error, happened to me when I misspell variable name. In result couldn't figure out what's wrong.










share|improve this question
























  • I am getting "Uncaught ReferenceError: addon is not defined" as expected
    – Rohith K N
    Nov 10 at 9:24










  • @RohithKN no it's not :D Maybe it's different in versions I use Firefox Quantum 63.0.1.
    – Sonny D
    Nov 10 at 15:01










  • Might be worth reporting this issue as a Firefox bug. I'm pretty sure some versions ago content script errors were reported, but now they are nowhere to be found.
    – Andrew Svietlichnyy
    Nov 11 at 11:42

















up vote
3
down vote

favorite
1












I know that to debug content script use normal web developer tools (https://developer.mozilla.org/en/docs/Mozilla/Add-ons/WebExtensions/Debugging#Debugging_content_scripts), and this works perfect. debugger keyword works as intended.



But in this exact situation things get broken:



addon.id = "123-568-485"; // I never define `addon` before this line, so this cause: ReferenceError: "addon is not defined". We aren't aware of this mistake.

// Some more code
// Some more code
// Some more code
// Some more code

debugger; // Here we want to stop execution and inspect, some other stuff. Remember that we aren't aware of earlier mistake.


What we would expect, that in console error about Reference error will appear, but it doesn't. Console get silent, and we don't know why our debugger keyword doesn't work.



This kind of silent error, happened to me when I misspell variable name. In result couldn't figure out what's wrong.










share|improve this question
























  • I am getting "Uncaught ReferenceError: addon is not defined" as expected
    – Rohith K N
    Nov 10 at 9:24










  • @RohithKN no it's not :D Maybe it's different in versions I use Firefox Quantum 63.0.1.
    – Sonny D
    Nov 10 at 15:01










  • Might be worth reporting this issue as a Firefox bug. I'm pretty sure some versions ago content script errors were reported, but now they are nowhere to be found.
    – Andrew Svietlichnyy
    Nov 11 at 11:42















up vote
3
down vote

favorite
1









up vote
3
down vote

favorite
1






1





I know that to debug content script use normal web developer tools (https://developer.mozilla.org/en/docs/Mozilla/Add-ons/WebExtensions/Debugging#Debugging_content_scripts), and this works perfect. debugger keyword works as intended.



But in this exact situation things get broken:



addon.id = "123-568-485"; // I never define `addon` before this line, so this cause: ReferenceError: "addon is not defined". We aren't aware of this mistake.

// Some more code
// Some more code
// Some more code
// Some more code

debugger; // Here we want to stop execution and inspect, some other stuff. Remember that we aren't aware of earlier mistake.


What we would expect, that in console error about Reference error will appear, but it doesn't. Console get silent, and we don't know why our debugger keyword doesn't work.



This kind of silent error, happened to me when I misspell variable name. In result couldn't figure out what's wrong.










share|improve this question















I know that to debug content script use normal web developer tools (https://developer.mozilla.org/en/docs/Mozilla/Add-ons/WebExtensions/Debugging#Debugging_content_scripts), and this works perfect. debugger keyword works as intended.



But in this exact situation things get broken:



addon.id = "123-568-485"; // I never define `addon` before this line, so this cause: ReferenceError: "addon is not defined". We aren't aware of this mistake.

// Some more code
// Some more code
// Some more code
// Some more code

debugger; // Here we want to stop execution and inspect, some other stuff. Remember that we aren't aware of earlier mistake.


What we would expect, that in console error about Reference error will appear, but it doesn't. Console get silent, and we don't know why our debugger keyword doesn't work.



This kind of silent error, happened to me when I misspell variable name. In result couldn't figure out what's wrong.







javascript debugging firefox-addon






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 15:39

























asked Nov 10 at 7:59









Sonny D

162215




162215












  • I am getting "Uncaught ReferenceError: addon is not defined" as expected
    – Rohith K N
    Nov 10 at 9:24










  • @RohithKN no it's not :D Maybe it's different in versions I use Firefox Quantum 63.0.1.
    – Sonny D
    Nov 10 at 15:01










  • Might be worth reporting this issue as a Firefox bug. I'm pretty sure some versions ago content script errors were reported, but now they are nowhere to be found.
    – Andrew Svietlichnyy
    Nov 11 at 11:42




















  • I am getting "Uncaught ReferenceError: addon is not defined" as expected
    – Rohith K N
    Nov 10 at 9:24










  • @RohithKN no it's not :D Maybe it's different in versions I use Firefox Quantum 63.0.1.
    – Sonny D
    Nov 10 at 15:01










  • Might be worth reporting this issue as a Firefox bug. I'm pretty sure some versions ago content script errors were reported, but now they are nowhere to be found.
    – Andrew Svietlichnyy
    Nov 11 at 11:42


















I am getting "Uncaught ReferenceError: addon is not defined" as expected
– Rohith K N
Nov 10 at 9:24




I am getting "Uncaught ReferenceError: addon is not defined" as expected
– Rohith K N
Nov 10 at 9:24












@RohithKN no it's not :D Maybe it's different in versions I use Firefox Quantum 63.0.1.
– Sonny D
Nov 10 at 15:01




@RohithKN no it's not :D Maybe it's different in versions I use Firefox Quantum 63.0.1.
– Sonny D
Nov 10 at 15:01












Might be worth reporting this issue as a Firefox bug. I'm pretty sure some versions ago content script errors were reported, but now they are nowhere to be found.
– Andrew Svietlichnyy
Nov 11 at 11:42






Might be worth reporting this issue as a Firefox bug. I'm pretty sure some versions ago content script errors were reported, but now they are nowhere to be found.
– Andrew Svietlichnyy
Nov 11 at 11:42














1 Answer
1






active

oldest

votes

















up vote
0
down vote













Content scripts are executed in webpage, So as you know to see it's output you should open up console menu in that specific web page (ctrl+shift+e then go to console).

But if something is wrong with content script and cause it to throw exception, The error log would be shown in debug area of your extension in: about:debugging



enter image description here



I think the reason is content scripts are treated like extra frame for webpage and their error is shown there.






share|improve this answer





















  • console on about:debugging is also silent.Whatsmore I check Add-on Debugger, even I know that there should be nothing because MDN say You can use the Add-on Debugger to debug background pages, options pages, and popups. However, you can't use it to debug content scripts.
    – Sonny D
    Nov 10 at 15:35











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%2f53237090%2fconsole-doesnt-log-js-errors-from-content-script%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








up vote
0
down vote













Content scripts are executed in webpage, So as you know to see it's output you should open up console menu in that specific web page (ctrl+shift+e then go to console).

But if something is wrong with content script and cause it to throw exception, The error log would be shown in debug area of your extension in: about:debugging



enter image description here



I think the reason is content scripts are treated like extra frame for webpage and their error is shown there.






share|improve this answer





















  • console on about:debugging is also silent.Whatsmore I check Add-on Debugger, even I know that there should be nothing because MDN say You can use the Add-on Debugger to debug background pages, options pages, and popups. However, you can't use it to debug content scripts.
    – Sonny D
    Nov 10 at 15:35















up vote
0
down vote













Content scripts are executed in webpage, So as you know to see it's output you should open up console menu in that specific web page (ctrl+shift+e then go to console).

But if something is wrong with content script and cause it to throw exception, The error log would be shown in debug area of your extension in: about:debugging



enter image description here



I think the reason is content scripts are treated like extra frame for webpage and their error is shown there.






share|improve this answer





















  • console on about:debugging is also silent.Whatsmore I check Add-on Debugger, even I know that there should be nothing because MDN say You can use the Add-on Debugger to debug background pages, options pages, and popups. However, you can't use it to debug content scripts.
    – Sonny D
    Nov 10 at 15:35













up vote
0
down vote










up vote
0
down vote









Content scripts are executed in webpage, So as you know to see it's output you should open up console menu in that specific web page (ctrl+shift+e then go to console).

But if something is wrong with content script and cause it to throw exception, The error log would be shown in debug area of your extension in: about:debugging



enter image description here



I think the reason is content scripts are treated like extra frame for webpage and their error is shown there.






share|improve this answer












Content scripts are executed in webpage, So as you know to see it's output you should open up console menu in that specific web page (ctrl+shift+e then go to console).

But if something is wrong with content script and cause it to throw exception, The error log would be shown in debug area of your extension in: about:debugging



enter image description here



I think the reason is content scripts are treated like extra frame for webpage and their error is shown there.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 at 9:29









Jafar Akhondali

977619




977619












  • console on about:debugging is also silent.Whatsmore I check Add-on Debugger, even I know that there should be nothing because MDN say You can use the Add-on Debugger to debug background pages, options pages, and popups. However, you can't use it to debug content scripts.
    – Sonny D
    Nov 10 at 15:35


















  • console on about:debugging is also silent.Whatsmore I check Add-on Debugger, even I know that there should be nothing because MDN say You can use the Add-on Debugger to debug background pages, options pages, and popups. However, you can't use it to debug content scripts.
    – Sonny D
    Nov 10 at 15:35
















console on about:debugging is also silent.Whatsmore I check Add-on Debugger, even I know that there should be nothing because MDN say You can use the Add-on Debugger to debug background pages, options pages, and popups. However, you can't use it to debug content scripts.
– Sonny D
Nov 10 at 15:35




console on about:debugging is also silent.Whatsmore I check Add-on Debugger, even I know that there should be nothing because MDN say You can use the Add-on Debugger to debug background pages, options pages, and popups. However, you can't use it to debug content scripts.
– Sonny D
Nov 10 at 15:35


















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f53237090%2fconsole-doesnt-log-js-errors-from-content-script%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







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini