For a poor souls that are trying to find the way to print a single clickable line and not the whole stack trace:
let message = `Oh, hello there 👋`;
let functionName = `function`;
let path = `https://stackoverflow.com/questions/43666085/log-a-link-to-a-source-code-in-firefox-console`;
let line = 10;
let column = 20;
let error = new Error();
error.name = message;
error.stack = `${functionName}@${path}:${line}:${column}`;
console.log(error);