From ada88090ead2c3b9d0804794c5f20f9b24d1c2b1 Mon Sep 17 00:00:00 2001 From: Nik Nyby Date: Sat, 17 Jan 2015 17:12:36 -0500 Subject: Import to new git repository The old repository was using almost 100mb of space because of all the unnecessary files in the history. So I've imported the code to a new git repository. Unfortunately the history isn't viewable from this repository anymore. To see what happened with LibreJS before 2015, see the old Bazaar repo here: http://bzr.savannah.gnu.org/lh/librejs/ --- doc/manual/html_node/JavaScript-Detection.html | 165 +++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 doc/manual/html_node/JavaScript-Detection.html (limited to 'doc/manual/html_node/JavaScript-Detection.html') diff --git a/doc/manual/html_node/JavaScript-Detection.html b/doc/manual/html_node/JavaScript-Detection.html new file mode 100644 index 0000000..1ce0f95 --- /dev/null +++ b/doc/manual/html_node/JavaScript-Detection.html @@ -0,0 +1,165 @@ + + + + + +GNU LibreJS 6.0.8.20150117: JavaScript Detection + + + + + + + + + + + + + + + + + + + +
+

+Next: , Previous: , Up: Top   [Contents]

+
+
+ +

5 JavaScript Detection

+ + + + +

In practice, the JavaScript code in your page may be found trivial by +LibreJS if, as a whole: +

+ +

However, in some instances, you may be required by LibreJS to add a +stylized comment to JavaScript code that may be otherwise trivial. +

+

When an external file defines a function, it becomes available +to all other external scripts. That is the case if another script +defines a function that makes AJAX calls, when an external script +loads other scripts dynamically (which in turn could also make AJAX +calls, …), or when a script is written with constructs that may do +any of these. +

+

For instance, if your page contains the following: +

+
<script src="jquery.js"></script>
+<script>
+$.doSomething();
+</script>
+
+ +

While $.doSomething(); may seem trivial, you will nevertheless +have to add a stylized license comment on your main HTML page because +the external script (in this case jQuery) has been found to define +methods that make AJAX calls. $.doSomething() might make an AJAX call, +and LibreJS does not check for that. The rule of thumb is that when you +use a library or code that handles AJAX, JSON, JSONP, the loading of +scripts dynamically, you should have license mentions for all your +JavaScript files and for your main page regardless. In practice this is +a case that happens very often with code that uses libraries. +

+

In practice also, the JavaScript code in an external file (an external +.js file loaded on your page) may be found trivial if it does not +define functions/methods. +

+

And in the same manner it will be considered nontrivial if AJAX calls, +dynamic script loading, or non-obvious dynamic JavaScript constructs +are used in another script. +

+

If your JavaScript code makes AJAX requests, it’s important to get an +accurate Content-Type in the response from the server. For +example, if you’re using JSON, set it to application/json. +This is because LibreJS alters the content of text/html +responses. +

+
+
+

+Next: , Previous: , Up: Top   [Contents]

+
+ + + + + -- cgit v1.2.3