File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,21 @@ http://ryanmorr.com/using-mutation-observers-to-watch-for-element-availability/
56
56
57
57
Special thanks to [ Ryan Morr] ( http://ryanmorr.com/ )
58
58
59
+ ## How do I inject large JavaScript
60
+
61
+ You can host the JS code in public accessible url and dynamically load and eval it. A sample implementation like this:
62
+
63
+ ```
64
+ customjsReady('body', function(element) {
65
+ fetch('https://gist.githubusercontent.com/xcv58/5aaeda690ace2f468d51dbf9c65a3980/raw/a8b1c59223892fb2be08490b00c84fa4a029bb8e/test.js')
66
+ .then((res) => res.text())
67
+ .then((js) => {
68
+ console.log('works in fetch', js)
69
+ eval(js);
70
+ })
71
+ });
72
+ ```
73
+
59
74
# Why Custom JavaScript for Websites 2
60
75
Since the author haven't update original extension for almost one year.
61
76
Its website http://hromadadan.com is also unavailable.
You can’t perform that action at this time.
0 commit comments