copyright intellectual-property internet software
Legal status of js code on web-site
<p>Normally, every code, distributed to be run on user machines, come with a license. If you do not agree with a license, you can't run a code. Moreover, license clearly states responsibility of the vendor, what uses are permitted, etc.</p>
<p>If you visit a site (f.e. law.stackexchange.com), it contains links to a code (javascript) to be automatically loaded and executed by user's computer in a browser.</p>
<p>What rules are governing those relations?</p>
<ol>
<li>Browser runs code automatically, and it's by design. Authors put a lot of efforts to make it 'automatically run'.</li>
<li>User hasn't consented to any license before executing a code.</li>
</ol>
<p>I see two options:</p>
<ol>
<li>Every user run code without a license, and is guilty of breaking copyright.</li>
<li>There is an implicit permission to run a code (by the way it was implemented).</li>
</ol>
<p>But if there is an 'implicit permission', where this permission ends? Can user download a code (it's already downloading it), save it (it's already saving it to the browser cache), and run in own environment (it's already running it)? And if so, can user do this (download-save-execute) in 'unexpected' environment? F.e. instead of browser with UI, execute it in own <code>phantom.js</code> or other 'headless' browser for own merits, outside of intentions of code authors?</p>
<p>How this situation is handled? Is it legal to execute a JS from publicly available site?</p>

<p>This question is somewhat answered <a href="https://www.bitlaw.com/copyright/license.html#implied" rel="nofollow noreferrer">here</a>:</p>
<blockquote>
<p>A commonly discussed scenario where implied licenses are destined to
play a major role is on the World Wide Web. When a Web page is viewed
in a Web browser, the page is downloaded through the Internet and
placed on the user's screen. It is clear that a copy of the Web page
is being made by the user. It is also clear that the Web page is
protected against unauthorized copying by copyright law. But it would
not make sense to allow the author of a Web page to sue a user who
viewed her page, since the author intended that the page be viewed by
others when she placed it on the World Wide Web. Rather, attorneys
argue, courts should find that the Web page author has given end users
an implied license to download and view the Web page. <em>The extent of
this implied license is unclear, and may someday be defined by the
courts</em>.</p>
</blockquote>
<p><a href="https://scholarship.law.unc.edu/cgi/viewcontent.cgi?referer=https://www.google.com/&amp;httpsredir=1&amp;article=4261&amp;context=nclr" rel="nofollow noreferrer">This article</a> discusses the issue and includes discussion of case law, but your question is not answered, in the US, other than to say that there is an implied license. <a href="https://www.courtlistener.com/opinion/2408379/field-v-google-inc/" rel="nofollow noreferrer">Field v. Google</a>, Inc., 412 F.Supp. 2d 1106 seems to be most on-point: see the implied license section of the opinion, where the court granted Google access to an implied license defense because plaintiff failed to take the actions standardly taken to override an implied license. But the court did not draw bright lines as to what usage is (in general) implicitly licensed – that would depends on the surrounding customs of computer usage.</p>
<p>The basic logic of the implied license is that it would make no sense for a person to put out a web page that executes code and not intend that the code be executed: it it does make sense that they didn't intend the code to be copied and redistributed. The line is somewhere between those two extremes (don't even execute, vs. complete permission).</p>

<h2>Copyright restricts making copies, it does not restrict using copies you legally have</h2>
<p>When I buy a book, I’m allowed to read it, put it on my bookshelf, take it off the bookshelf and put it on my coffee table, take it from there and lose it under the seat of my car etc. what I’m not allowed to do is copy it.</p>
<p>When I access a web page, I’m allowed to display it in a browser, execute any code that comes with it, read the code etc. what I’m not allowed to do is copy it.</p>
