Skip to content Skip to sidebar Skip to footer

Inline Javascript Stacktrace: Better Origin Than @

I'm working on a Chrome extension. I need to append Javsacript as inline-script for content security purposes. The issue now is that, because script is inlined, the stacktrace show

Solution 1:

Insert the following snippet before or after your code:

//# sourceURL=name-of-script.js

Now, whenever your code throws an error, you will see "name-of-script.js" instead of <anonymous>. This feature is a part of Source maps, you can read more about this feature in the Chrome devtools documentation.

Post a Comment for "Inline Javascript Stacktrace: Better Origin Than @"