console-powers icon indicating copy to clipboard operation
console-powers copied to clipboard

How to Add href or Link to console.message

Open stephenaryee opened this issue 8 years ago • 2 comments

Thanks a lot for this console script, but I have an issue. Anytime I add .element('feedback') to console.message(). It still repeat the same way in the console. How do add a link to it below is my code:

console.message() .span({ fontWeight: 'normal'}) .text('Please don't copy-paste something or hack here!', {background: 'red', color: 'white',fontWeight: 'bold',fontSize: 15 }) .element('feedback') .spanEnd() .print();

stephenaryee avatar Oct 04 '17 12:10 stephenaryee

.element() method ​expects HTMLElement instance. You could do console.message().element(document.querySelector('CSS selector here')).print()

What do you mean "add a link to it"?

astoilkov avatar Oct 04 '17 12:10 astoilkov

What I meant by add a link is: an hyperlink or href

stephenaryee avatar Oct 04 '17 16:10 stephenaryee

Unfortunately, this isn't supported by the browser console APIs. I can make a utility function that only colors the link but it still won't be possible to click it. Closing this.

Sorry for the delayed answer 😂. I didn't commit to this repo for the past 8 years. Now I've started working on it all over again.

astoilkov avatar Dec 14 '23 11:12 astoilkov