javascript-trap.html - en to zh_TW translation catalogue (43 entries)

note: type: Content of: <h2>
en: The JavaScript Trap
zh_TW: JavaScript 的陷阱

note: type: Content of: <p>
en: by <a href="http://www.stallman.org/">Richard Stallman</a>
zh_TW: 作者為 <a href="http://www.stallman.org/">Richard Stallman</a>

note: type: Content of: <p>
en: <strong>You may be running nonfree programs on your computer every day without realizing it&mdash;through your web browser.</strong>
zh_TW: <strong>你可能每天都在你的電腦上執行非自由軟體而不自知──透過你的瀏覽器。</strong>

note: type: Content of: <blockquote><p>
en: Webmasters: there are <a href="/software/librejs/free-your-javascript.html">several ways</a> to indicate the license of JavaScript programs in a web site.
zh_TW: 網站管理員：有<a href="/software/librejs/free-your-javascript.html">好幾種方法</a>可以在網站上指出 JavaScript 程式的授權條款。

note: type: Content of: <p>
en: In the free software community, the idea that <a href="/philosophy/free-software-even-more-important.html"> any nonfree program mistreats its users</a> is familiar.  Some of us defend our freedom by rejecting all proprietary software on our computers.  Many others recognize nonfreeness as a strike against the program.
zh_TW: 在自由軟體社群中，<a href="/philosophy/free-software-even-more-important.html">非自由軟體會侵害自己的使用者</a>的概念大家都很熟悉。有些人會拒絕在電腦上使用任何專有軟體，藉此捍衛自由。還有許多人意識到非自由並拒絕了那些程式。

note: type: Content of: <p>
en: Many users are aware that this issue applies to the plug-ins that browsers offer to install, since they can be free or nonfree.  But browsers run other nonfree programs which they don't ask you about, or even tell you about&mdash;programs that web pages contain or link to.  These programs are most often written in JavaScript, though other languages are also used.
zh_TW: 許多使用者知道瀏覽器要求安裝的外掛程式有此問題，因為它們可能是自由或非自由的。但瀏覽器也會執行其他不會向你要求許可的非自由軟體，甚至連告訴你都沒有，就是那些網頁包含或連結到的程式。這些程式通常以 JavaScript 編寫，雖然也可能會使用其他語言。

note: type: Content of: <p>
en: JavaScript (officially called ECMAScript, but few use that name)  was once used for minor frills in web pages, such as cute but inessential navigation and display features.  It was acceptable to consider these as mere extensions of HTML markup, rather than as true software, and disregard the issue.
zh_TW: JavaScript（正式名稱為 ECMAScript，但目前很少有人使用此名稱）曾經只用於網頁中不重要的裝飾，如可愛但不重要的導覽與顯示功能。可以把這些當作只是 HTML 標記語言的擴展，而不是真正的軟體，這樣就可以忽略這個問題。

note: type: Content of: <p>
en: Some sites still use JavaScript that way, but many use it for major programs that do large jobs.  For instance, Google Docs tries to install into your browser a JavaScript program which measures half a megabyte, in a compacted form that we could call Obfuscript.  This compacted form is made from the source code, by deleting the extra spaces that make the code readable and the explanatory remarks that make it comprehensible, and replacing each meaningful name in the code with an arbitrary short name so we can't tell what it is supposed to mean.
zh_TW: 某些網站仍然以這種方式使用 JavaScript，但許多網站已將其用於完成任務的主要程式。舉例來說，Google 文件會嘗試在你的電腦上下載大約 500KB 的 JavaScript 程式，而這個程式使用了我們稱之為模糊指令稿 (Obfuscript) 的緊湊格式。這種格式刪除了原始碼中有助於閱讀的空格與注釋，並將原本有意義的方法名稱替換成任意的簡稱，這樣人們就無法看出這些方法原本的意義。

note: type: Content of: <p>
en: Part of the <a href="/philosophy/free-sw.html">meaning of free software</a> is that users have access to the program's source code (its plan).  The source code of a program means the preferred form for programmers to modify&mdash;including helpful spacing, explanatory remarks, and meaningful names.  Compacted code is a bogus, useless substitute for source code; the real source code of these programs is not available to the users, so users cannot understand it; therefore the programs are nonfree.
zh_TW: <a href="/philosophy/free-sw.html">自由軟體的定義</a>包含了使用者可以存取程式的原始碼。而程式的原始碼應該是利於修改的形式──包含利於閱讀的空格與分行、解釋性的注釋與有意義的名稱。這種緊密的格式不是原始碼，而只是毫無用處的原始碼替代品；其原始碼並沒有提供給使用者，因而使用者無法了解該程式，這樣使用者就無法了解該程式；因此這種程式是非自由的。

note: type: Content of: <p>
en: In addition to being nonfree, many of these programs are <em>malware</em> because they <a href="http://github.com/w3c/fingerprinting-guidance/issues/8">snoop on the user</a>.  Even nastier, some sites use services which record <a href="https://freedom-to-tinker.com/2017/11/15/no-boundaries-exfiltration-of-personal-data-by-session-replay-scripts/">all the user's actions while looking at the page</a>.  The services supposedly &ldquo;redact&rdquo; the recordings to exclude some sensitive data that the web site shouldn't get.  But even if that works reliably, the whole purpose of these services is to give the web site other personal data that it shouldn't get.
zh_TW: 除了非自由以外，許多這類的程式都是<em>惡意程式</em>，因為它們會<a href="http://github.com/w3c/fingerprinting-guidance/issues/8">窺探使用者</a>。更糟糕的是，某些網站使用服務來紀錄<a href="https://freedom-to-tinker.com/2017/11/15/no-boundaries-exfiltration-of-personal-data-by-session-replay-scripts/">使用者瀏覽該網站時所有的行為</a>。這類的服務本應「修改」紀錄以抹除網站不應該取得的一些敏感資訊。但是，即便這類功能可以正確地運作，這類服務的目的也是給予網站他們根本不應取得的個人資訊。

note: type: Content of: <p>
en: Browsers don't normally tell you when they load JavaScript programs.  Some browsers have a way to turn off JavaScript entirely, but even if you're aware of this issue, it would take you considerable trouble to identify the nontrivial nonfree programs and block them.  However, even in the free software community most users are not aware of this issue; the browsers' silence tends to conceal it.
zh_TW: 一般來說，瀏覽器不會告訴你它們什麼時候會載入 JavaScript 程式。某些瀏覽器有方法可以完全關掉 JavaScript，但即便你知道有問題，你也要花費許多心力去辨別這些非自由軟體並阻擋它們。然而，即便是在自由軟體社群中，大多數的使用者也不知道這個問題；而瀏覽器的沉默也好似在掩蓋這個問題。

note: type: Content of: <p>
en: It is possible to release a JavaScript program as free software, by distributing the source code under a free software license.  If the program is self-contained&mdash;if its functioning and purpose are independent of the page it came in&mdash;that is fine; you can copy it to a file on your machine, modify it, and visit that file with a browser to run it.  But that is an unusual case.
zh_TW: 可以將 JavaScript 程式以自由軟體的形式釋出，只要使用自由軟體授權條款釋出其原始碼就行了。如果這個程式自給自足（亦即其功能與目的和使用它的網站並未直接相關），這樣就沒問題了；你可以將其複製到你的電腦，修改它，然後使用瀏覽器載入並執行它。但這並不是一般的情況。

note: type: Content of: <p>
en: In the usual case, JavaScript programs are meant to work with a particular page or site, and the page or site depends on them to function.  Then another problem arises: even if the program's source is available, browsers do not offer a way to run your modified version instead of the original when visiting that page or site.  The effect is comparable to tivoization, although in principle not quite so hard to overcome.
zh_TW: 一般來說，JavaScript 程式是用來與特定的頁面或網站一同運作，而這些頁面或網站必須要有這個程式才能正常運作。這就出現了另一個問題：即使有原始碼，瀏覽器也無法執行修改後的版本，除非你使用原來的版本存取特定的頁面或網站。這個的影響類似於 tivoization，雖然這個本質上並未如此難以克服。

note: type: Content of: <p>
en: JavaScript is not the only language web sites use for programs sent to the user.  Flash supports programming through an extended variant of JavaScript; if we ever have a sufficiently complete free Flash player, we will need to deal with the issue of nonfree Flash programs.  Silverlight seems likely to create a problem similar to Flash, except worse, since Microsoft uses it as a platform for nonfree codecs.  A free replacement for Silverlight does not do the job for the free world unless it normally comes with free replacement codecs.
zh_TW: JavaScript 並不是網站傳送給使用者的程式中唯一使用的語言。Flash 支援用一種擴展過的 JavaScript 編寫程式；如果我們有足夠完整的自由 Flash 播放器，我們就可以處理非自由的 Flash 程式所帶來的問題。Silverlight 的問題與 Flash 類似，但可能更糟，因為微軟用它作為非自由編解碼器的平臺。自由的 Silverlight 替代品在自由世界沒辦法正常運作，除非它還帶了一些自由的編解碼器替代品。

note: type: Content of: <p>
en: Java applets also run in the browser, and raise similar issues.  In general, any sort of applet system poses this sort of problem.  Having a free execution environment for an applet only brings us far enough to encounter the problem.
zh_TW: Java 小程式也會在瀏覽器中執行，當然也就會有一樣的問題。一般來說，各種小程式的系統都有類似的問題。建立一個執行小程式的自由環境只是讓我們看到這個問題而已。

note: type: Content of: <p>
en: It is theoretically possible to program in HTML and CSS, but in practice this capability is limited and inconvenient; merely to make it do something is an impressive hack.  Such programs ought to be free, but CSS is not a serious problem for users' freedom as of 2019.
zh_TW: 理論上可以使用 HTML 與 CSS 寫程式，但實際上其極其受限且不方便；最多只能用來展示一些令人驚奇的電腦程式技巧。這些程式理應是自由的，但 CSS 到2019年為止還不是影響使用者自由的重要因素。

note: type: Content of: <p>
en: A strong movement has developed that calls for web sites to communicate only through formats and protocols that are free (some say &quot;open&quot;); that is to say, whose documentation is published and which anyone is free to implement.  However, the presence of JavaScript programs in web pages makes that criterion insufficient.  The JavaScript language itself, as a format, is free, and use of JavaScript in a web site is not necessarily bad.  However, as we've seen above, it can be bad&mdash;if the JavaScript program is nonfree.  When the site transmits a program to the user, it is not enough for the program to be written in a documented and unencumbered language; that program must be free, too.  &ldquo;Transmits only free programs to the user&rdquo; must become part of the criterion for an ethical web site.
zh_TW: 已經有一個強大的運動，其號召網站只使用自由（有些人說「開放」）的格式與協定進行通訊；也就是說，它們的文件應該要公開，任何人都能自由實作。不過，當網頁有 JavaScript 程式時，這個標準就不夠了。JavaScript 本身，作為一種格式，是自由的，而且在網站上使用 JavaScript 並不見得是壞事。然而，正如上述所言，它也不見得就是好事，如果 JavaScript 程式是非自由軟體。當網站將程式轉移給使用者，程式由只是有文件、不受限制的語言編寫並不足夠；程式本身也必須是自由的。「只向使用者傳送自由軟體」必須成為網站行為規範的準則。

note: type: Content of: <p>
en: Silently loading and running nonfree programs is one among several issues raised by &quot;web applications&quot;.  The term &quot;web application&quot; was designed to disregard the fundamental distinction between software delivered to users and software running on a server.  It can refer to a specialized client program running in a browser; it can refer to specialized server software; it can refer to a specialized client program that works hand in hand with specialized server software.  The client and server sides raise different ethical issues, even if they are so closely integrated that they arguably form parts of a single program.  This article addresses only the issue of the client-side software.  We are addressing the server issue separately.
zh_TW: 不動聲色地載入並執行非自由軟體只是「網路應用程式」帶來的諸多問題中的其中一個。「網路應用程式」這個詞就是用來抹殺使用者軟體與伺服器軟體本質上的區別。它可以指在瀏覽器中執行的特定客戶端軟體；也可以指特定的伺服器軟體；當然還可以指與特定伺服器軟體緊密合作的客戶端軟體。客戶端與伺服器端有不同的道德問題，即便它們合作如此緊密，幾乎可以當成同一個軟體的不同部份。本文只討論客戶端軟體的部份。我們會分開討論伺服器端的軟體。

note: type: Content of: <p>
en: In practical terms, how can we deal with the problem of nontrivial nonfree JavaScript programs in web sites? The first step is to avoid running it.
zh_TW: 實際上，我們要如何處理網站上非自由也不平凡的 JavaScript 程式呢？第一步就是避免執行它們。

note: type: Content of: <p>
en: What do we mean by &quot;nontrivial&quot;? It is a matter of degree, so this is a matter of designing a simple criterion that gives good results, rather than finding the one correct answer.
zh_TW: 「非平凡」是什麼意思？它表示的是程度，所以它是指設計一種簡明的標準來獲得好的結果，而不是尋求唯一正確的答案。

note: type: Content of: <p>
en: Our current criterion is to consider a JavaScript program nontrivial if any of these conditions is met:
zh_TW: 我們目前的標準是，只要滿足以下任一條件，該 JavaScript 程式就會被認為是不平凡的：

note: type: Content of: <ul><li>
en: it is referred to as an external script (from another page).
zh_TW: 引用了外部指令碼（來自其他頁面）。

note: type: Content of: <ul><li>
en: it declares an array more than 50 elements long.
zh_TW: 其宣告了超過 50 個元素的陣列。

note: type: Content of: <ul><li>
en: it defines a named entity (function or method) that calls anything other than a primitive.
zh_TW: 其定義的主體（函式或方法）會做呼叫基本函式以外的呼叫。

note: type: Content of: <ul><li>
en: it defines a named entity with more than three conditional constructs and loop construction.
zh_TW: 其定義的主體帶有三個以上的條件判斷或循環結構。

note: type: Content of: <ul><li>
en: code outside of named definitions calls anything but primitives and functions defined further up in the page.
zh_TW: 除了定義以外，頁面的程式碼呼叫了該頁面上間隔很遠的非基本函式。

note: type: Content of: <ul><li>
en: code outside of named definitions contains more than three conditional constructs and loop construction, total.
zh_TW: 除了定義以外，頁面程式碼總計帶有三個以上的條件判斷或循環結構。

note: type: Content of: <ul><li>
en: it calls <b>eval</b>.
zh_TW: 其呼叫了 <b>eval</b>。

note: type: Content of: <ul><li>
en: it does Ajax calls.
zh_TW: 其有 Ajax 呼叫。

note: type: Content of: <ul><li>
en: it uses bracket notation for dynamic object property access, which looks like <b><em>object</em>[<em>property</em>]</b>.
zh_TW: 其使用了括號表示法來進行動態物件屬性存取，就像 <b><em>object</em>[<em>property</em>]</b> 這樣。

note: type: Content of: <ul><li>
en: it alters the DOM.
zh_TW: 其修改了 DOM。

note: type: Content of: <ul><li>
en: it uses dynamic JavaScript constructs that are difficult to analyze without interpreting the program, or is loaded along with scripts that use such constructs.  Specifically, using any other construct than a string literal with certain methods (<b>Obj.write</b>, <b>Obj.createElement</b>, and others).
zh_TW: 其使用了動態 JavaScript 結構，這種結構在不了解該程式的情況下很難分析，或是該程式與使用了這種結構的程式碼一同載入。具體來說就是程式使用了諸如帶有方法（<b>Obj.write</b>, <b>Obj.createElement</b> 與其他方法）之外的字串。

note: type: Content of: <p>
en: How do we tell whether the JavaScript code is free? In a <a href="/licenses/javascript-labels.html">separate article</a>, we propose a method by which a nontrivial JavaScript program in a web page can state the URL where its source code is located, and can state its license too, using stylized comments.
zh_TW: 我們如何判斷 JavaScript 程式碼是否自由？在<a href="/licenses/javascript-labels.html">另一篇文章中</a>，我們提議了一種方法，它指出網頁帶有的非平凡程式可以使用特定樣式的註釋來指出程式碼放置的 URL，也可以表明其授權條款。

note: type: Content of: <p>
en: Finally, we need to change free browsers to detect and block nontrivial nonfree JavaScript in web pages.  The program <a href="/software/librejs/">LibreJS</a> detects nonfree, nontrivial JavaScript in pages you visit, and blocks it.  LibreJS is included in IceCat, and available as an add-on for Firefox.
zh_TW: 最後，我們需要修改自由的瀏覽器來偵測並封鎖網頁中非平凡且非自由的 JavaScript 程式碼。<a href="/software/librejs/">LibreJS</a> 可以偵測你造訪的頁面中的非自由且非平凡的 JavaScript 程式碼，並封鎖它。LibreJS 已包在 IceCat 中，並可在 Firefox 上以附加元件的形式使用。

note: type: Content of: <p>
en: Browser users also need a convenient facility to specify JavaScript code to use <em>instead</em> of the JavaScript in a certain page.  (The specified code might be total replacement, or a modified version of the free JavaScript program in that page.)  Greasemonkey comes close to being able to do this, but not quite, since it doesn't guarantee to modify the JavaScript code in a page before that program starts to execute.  Using a local proxy works, but is too inconvenient now to be a real solution.  We need to construct a solution that is reliable and convenient, as well as sites for sharing changes.  The GNU Project would like to recommend sites which are dedicated to free changes only.
zh_TW: 瀏覽器使用者還需要一個方便的工具來指定要使用的 JavaScript 程式碼，<em>而不是</em>使用網頁上的程式碼。（指定的程式碼可以是完全的替代版本，也可是頁面上的自由 JavaScript 程式碼的修改版。）Greasemonkey 已經快要能夠做到這點了，不過還沒有，因為其無法保證可以在 JavaScript 開始執行前就取代掉它們。使用本機代理可行，但對於真正的解決方案來說還是太不方便。我們必須建立一個可靠且方便的解決方案，也要建立一個可以分享解決方案的網站。GNU 專案願意推薦僅致力於分享自由修改方法的網站。

note: type: Content of: <p>
en: These features will make it possible for a JavaScript program included in a web page to be free in a real and practical sense.  JavaScript will no longer be a particular obstacle to our freedom&mdash;no more than C and Java are now.  We will be able to reject and even replace the nonfree nontrivial JavaScript programs, just as we reject and replace nonfree packages that are offered for installation in the usual way.  Our campaign for web sites to free their JavaScript can then begin.
zh_TW: 這些措施讓網頁中包含的 JavaScript 程式變成實際和真正意義上的自由軟體變為可能。JavaScript 就不再是阻礙我們自由的特別障礙，就像現在的 C 與 Java 那樣。我們將來能夠拒絕並取代非自由且非平凡的 JavaScript 程式，就像我們拒絕那些以一般形式安裝的非自由軟體包一樣。那時，我們就能夠開始讓網站提供自由 JavaScript 程式碼的運動了。

note: type: Content of: <p>
en: In the mean time, there's one case where it is acceptable to run a nonfree JavaScript program: to send a complaint to the website operators saying they should free or remove the JavaScript code in the site.  Please don't hesitate to enable JavaScript temporarily to do that&mdash;but remember to disable it again afterwards.
zh_TW: 與此同時，在這種情形下執行 JavaScript 程式碼還是可以被接受的：用它來向網站管理員抱怨該網站應該移除 JavaScript 程式碼或讓它自由。請不要猶豫，你可以暫時啟用 JavaScript 來做這件事，只要記得之後停用它就好。

note: type: Content of: <p>
en: <strong>Acknowledgements:</strong> I thank <a href="/people/people.html#mattlee">Matt Lee</a> and <a href="http://ejohn.org">John Resig</a> for their help in defining our proposed criterion, and David Parunakian for bringing the problem to my attention.
zh_TW: <strong>致謝：</strong>我感謝 <a href="/people/people.html#mattlee">Matt Lee</a> 與 <a href="http://ejohn.org">John Resig</a>，他們協助我們定義了我們提議的標準，並感謝 David Parunakian 提醒我要注意這個問題。

note: type: Content of: <div><div><p>
en: Please send general FSF &amp; GNU inquiries to <a href="mailto:gnu@gnu.org">&lt;gnu@gnu.org&gt;</a>.  There are also <a href="/contact/">other ways to contact</a> the FSF.  Broken links and other corrections or suggestions can be sent to <a href="mailto:webmasters@gnu.org">&lt;webmasters@gnu.org&gt;</a>.
zh_TW: 請來信到 <a href="mailto:gnu@gnu.org">&lt;gnu@gnu.org&gt;</a> 詢問有關自由軟體基金會（FSF）和 GNU 的一般問題；或者<a href="/contact/">以其他方式</a>聯絡自由軟體基金會。至於損毀的連結及其他修正和建議，可以將之寄給 <a href="mailto:webmasters@gnu.org">&lt;webmasters@gnu.org&gt;</a>。

note: TRANSLATORS: Ignore the original text in this paragraph, replace it with the translation of these two: We work hard and do our best to provide accurate, good quality translations.  However, we are not exempt from imperfection. Please send your comments and general suggestions in this regard to <a hr
en: Please see the <a href="/server/standards/README.translations.html">Translations README</a> for information on coordinating and submitting translations of this article.
zh_TW: 我們努力盡所能提供貼切、品質良善的翻譯。然而，我們無法十全十美，還請將你的意見評述與一般建議寄給 <a href="mailto:web-translators@gnu.org">&lt;web-translators@gnu.org&gt;</a>。</p>
    <p>請參照 <a href="/server/standards/README.translations.html">翻譯讀我 README</a> 來瞭解協調和提交我們的網頁翻譯相關事宜。

note: type: Content of: <div><p>
en: This page is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International License</a>.
zh_TW: 本頁面採用<a rel="license" href="https://creativecommons.org/licenses/by-nd/4.0/deed.zh_TW">創用 CC 姓名標示-禁止改作 4.0 國際</a>條款給予授權。

note: TRANSLATORS: Use space (SPC) as msgstr if you don't want credits. type: Content of: <div><div>
en: *GNUN-SLOT: TRANSLATOR'S CREDITS*
zh_TW: <b>翻譯</b>：黃柏諺 <a href="mailto:s8321414 (at) gmail (dot) com">&lt;s8321414 (at) gmail (dot) com&gt;</a>, 2019.

note: timestamp start type: Content of: <div><p>
en: Updated:
zh_TW: 更新時間︰
