Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
build:
./node_modules/.bin/uglifyjs2 stacktrace-bookmarklet.js -o stacktrace-bookmarklet.min.js
./node_modules/.bin/uglifyjs2 src/stacktrace-bookmarklet.js -o stacktrace-bookmarklet.js
cat src/bookmarklet-1 stacktrace-bookmarklet.js src/bookmarklet-2 > bookmarklet.html

deploy: build
npm publish

clean:
rm -fr stacktrace-bookmarklet.min.js
rm -fr stacktrace-bookmarklet.js bookmarklet.html

.PHONY: clean
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
# License
This is free and unencumbered software released into the public domain. See the full [LICENSE](https://raw.github.com/stacktracejs/stacktrace-bookmarklet/master/LICENSE)

[Page with generated bookmarklet](bookmarklet.html)
11 changes: 11 additions & 0 deletions bookmarklet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Bookmarklet</title>
</head>
<body>
Drag this link to your bookmarks or favorites bar
<a href="javascript:(function(w,d,c,s,e,i){c=d.createElement('div');s=c.style;s.position='fixed';s.top='0';s.right='0';s.backgroundColor='#ddd';s.padding='0.3em';s.margin='0%20auto';e=d.createElement('span');s=e.style;s.fontWeight='bold';s.marginRight='1em';e.innerHTML='Javascript%20Stacktrace:%20';c.appendChild(e);e=d.createElement('input');e.type='button';e.value='Load%20stacktrace.js';e.style.marginRight='1em';e.onclick=function(e,s){s=d.createElement('script');s.type='text/javascript';s.src='//rawgithub.com/stacktracejs/stacktrace.js/master/stacktrace.js';d.getElementsByTagName('head')[0].appendChild(s)};c.appendChild(e);e=d.createElement('input');e.type='button';e.value='Attach%20to%20window.onerror';e.style.marginRight='1em';e.onclick=function(){w.onerror=function(){alert(printStackTrace().join('\n'))}};c.appendChild(e);i=d.createElement('input');i.type='text';c.appendChild(i);e=d.createElement('input');e.type='button';e.value='Attach%20to%20custom%20function';e.style.marginRight='2em';e.onclick=function(e,fn){fn=i.value;eval('_old_'+fn+'='+fn+';'+fn+'=function(){alert(printStackTrace().join(&quot;\\n&quot;));_old_'+fn+'.apply(this,arguments);}')};c.appendChild(e);e=d.createElement('a');e.onclick=function(){c.parentNode.removeChild(c)};s=e.style;s.textDecoration='none';s.cursor='pointer';e.innerHTML='&#215;';c.appendChild(e);(d.body||d.getElementsByTagName('body')[0]).appendChild(c);})(window,document);">Stack Trace</a>
</body>
</html>
9 changes: 9 additions & 0 deletions src/bookmarklet-1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Bookmarklet</title>
</head>
<body>
Drag this link to your bookmarks or favorites bar
<a href="
3 changes: 3 additions & 0 deletions src/bookmarklet-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
">Stack Trace</a>
</body>
</html>
File renamed without changes.
1 change: 0 additions & 1 deletion stacktrace-bookmarklet.min.js

This file was deleted.