{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \n\n```\n\nIn contrast, if the above page did not listen for the `pageshow` event and handled all calculations as part of the `load` event (and instead was coded as shown in the sample code fragment below), both the cursor position and date/time would be cached in Firefox 1.5 when the user navigated away from the page. When the user returned to the page, the cached date/time would display.\n\n```html\n\n\n\n\n```\n\n## Developing Firefox extensions\n\nFirefox 1.5 [extensions](/en-US/docs/Mozilla/Add-ons) need to allow for this caching functionality. If you are developing a Firefox extension that you want to be compatible with both 1.5 and earlier versions, make sure that it listens for the `load` event for triggers that can be cached and listens for the `pageshow` event for triggers that shouldn't be cached.\n\nFor instance, the Google Toolbar for Firefox should listen for the `load` event for the autolink function and to the `pageshow` event for the PageRank function in order to be compatible with both 1.5 and earlier versions.\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":8279,"cells":{"repo_id":{"kind":"string","value":"data/mdn-content/files/en-us/mozilla/firefox/releases/1.5"},"file_path":{"kind":"string","value":"data/mdn-content/files/en-us/mozilla/firefox/releases/1.5/what_s_new_in_1.5_alpha/index.md"},"content":{"kind":"string","value":"---\ntitle: What's New in Deer Park Alpha\nslug: Mozilla/Firefox/Releases/1.5/What_s_new_in_1.5_alpha\npage-type: guide\n---\n\n{{FirefoxSidebar}}\n\nThis page is based largely on [https://www.squarefree.com/burningedg...eases/](https://www.squarefree.com/burningedge/releases/) (thanks Jesse).\n\n### New Web Developer Features\n\n#### HTML\n\n- Elements with `tabindex=\"-1\"` should be focusable\n - : Elements with a negative tabIndex attribute can now have focus, even though they are not in the tab order.\n- Object should submit\n - : In accordance with the HTML4 specification, `` elements can now be submitted as part of a form.\n\n#### CSS\n\n- CSS2 quotes nesting\n - : Starting with this release, the [`quotes` CSS2 property](https://www.w3.org/TR/CSS21/generate.html#quotes-specify) is fully supported, with the correct quote (depending on the nesting level) used for open-quote and close-quote.\n- CSS3 `:only-child`\n - : This CSS3 selector allows [selecting an element](https://www.w3.org/TR/2001/CR-css3-selectors-20011113/#only-child-pseudo) that has no other elements as siblings in the DOM.\n- CSS3 columns\n - : An experimental implementation of the proposed [CSS3 multicolumn layout](https://www.w3.org/TR/2001/WD-css3-multicol-20010118/) draft. This allows easily doing newspaper-like multicolumn presentation.\n- CSS3 `overflow-x` and `overflow-y` properties\n - : These properties can be used to control the overflow behavior in the horizontal and vertical directions somewhat independently. For example, overflow in the horizontal direction could be hidden while overflow in the vertical direction can be scrolled to.\n- CSS3 cursors\n - : More [mouse cursor names](https://www.w3.org/TR/css-ui-3/#cursor) are now supported.\n- URI values on CSS `cursor` properties\n - : On Windows, OS/2 and Linux (Gtk+ 2.x) one can now use an arbitrary image as the mouse cursor while a given DOM node is being hovered.\n Any image format supported by Gecko can be used for the image.\n (SVG, animated GIF, and ANI cursors are not supported.)\n See {{CSSxRef(\"cursor\")}} for a description of the feature.\n- `-moz-outline-radius`\n - : CSS outlines can now have rounded corners.\n- CSS `outline` property\n - : [CSS outlines](https://www.w3.org/TR/css-ui-3/#outline1) can now be used. These differ from borders in that they don't affect the page layout.\n- Counters in CSS-generated content\n - : [CSS2 counters](https://www.w3.org/TR/CSS21/generate.html#counters) are now completely supported (the implementation doesn't match the current CSS2.1 draft, but matches the upcoming one). This allows automatic numbering of sections, headings, and so forth via stylesheets.\n\n#### JavaScript and DOM\n\n- Array extras\n - : New methods have been added to the Array object to facilitate common tasks. See [JavaScript 1.5 Array Object](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).\n- `document.open(\"text/plain\")`\n - : Text written in new documents created with document.open(\"text/plain\") is now treated as text rather than HTML, so line breaks will remain intact and tags will not be parsed.\n- XML Events\n - : \"XML Events\" is a W3C specification to provide XML languages with the ability to integrate declarative event listeners and event handlers.\n- Cancelling keydown\n - : Cancelling the keydown event now properly cancels any corresponding keyup/keypress events, per the DOM specification.\n- Accessibility APIs for DHTML\n - : Mozilla now allows DHTML authors to add role and state semantics to custom elements, and exposes that information via MSAA and ATK.\n- DHTML Performance Fixes\n - : A number of changes were made to significantly improve DHTML speed and smoothness.\n\n#### Graphics\n\n- SVG Support\n - : SVG is W3C specification providing resolution-independent scalable vector graphics, along with a DOM. A technology preview of native SVG support is included in this release. Currently a subset of SVG 1.1 Full, missing functionality includes filters, declarative animation, and SVG defined fonts.\n- `` Support\n - : `` is a scriptable drawing surface for dynamically creating bitmap graphics. For a further introduction, see [Drawing Graphics with Canvas](/en-US/Drawing_Graphics_with_Canvas).\n\n#### Miscellaneous\n\n- Support HTTP/1.1 408 response code\n - : A persistent connection is now correctly closed when a 408 response code (Request timeout) is received. The request is retried in a new connection.\n- URIs always sent as UTF8\n - : URIs are now always sent to the server as UTF8, regardless of the linking page's encoding. This fixes images and links on sites with non-ASCII filenames.\n- XForms support\n - : The [W3C's XML Forms](https://www.w3.org/MarkUp/Forms/) language allows writing complex forms in XML, and includes features that regular HTML forms do not have, such as client side validation against [XML Schema](https://www.w3.org/XML/Schema) and XML submission/retrieval. Support for XForms comes as an extension, see [Mozilla XForms Project Page](/en-US/docs/Archive/Web/XForms).\n\n### New Extension Developer Features\n\n- Hidden referrer column for history\n\n - : Extensions can now access the referer information for pages stored in the browser history. This feature can be used to provide alternate history views and other useful functionality. [Firefox bug 128398](https://bugzil.la/128398)\n\n- API for prioritizing HTTP connections\n\n - : The Mozilla networking library now supports the prioritization of connections to a specific server using `nsISupportsPriority`. [Firefox bug 278531](https://bugzil.la/278531)\n\n- API for managing user and UA stylesheets\n\n - : Extensions can now register stylesheet URIs as additional user and UA stylesheets. This means extensions no longer have to try to edit `userContent.css` to add styling (say for XBL binding attachment) to web pages. See [Using the Stylesheet Service](/en-US/docs/Archive/Add-ons/Using_the_Stylesheet_Service).\n\n- API for configuring proxies\n\n - : It is now possible for extensions to easily override the proxy configuration without affecting user-visible preferences. See `nsIProtocolProxyService`, `nsIProtocolProxyFilter`, and `nsIProtocolProxyCallback`. [Firefox bug 282442](https://bugzil.la/282442)\n\n- Dynamic Overlays\n\n - : Loading of XUL overlays after the document has been displayed is now supported. See `nsIDOMXULDocument`. [Firefox bug 282103](https://bugzil.la/282103)\n\n- ECMAScript for XML (E4X)\n\n - : The Mozilla JavaScript engine now supports ECMAScript for XML (E4X), a draft ECMA standard that adds native XML datatypes to the language and provides operators for common XML operations. See [the ECMA specification](https://ecma-international.org/publications-and-standards/standards/ecma-357/). [Firefox bug 246441](https://bugzil.la/246441)\n\n- Translucent Windows (Windows/Linux)\n\n - : On Windows and Linux, XUL windows with a transparent background are now supported. This allows whatever is below the window to shine through the window background.\n\n- Adding tokens to the User-Agent string\n\n - : It is now possible for applications, extensions, and vendors to all add tokens to the User-Agent string (using default preferences) without overwriting each other.\n See [documentation](/en-US/docs/Web/HTTP/Headers/User-Agent). [Firefox bug 274928](https://bugzil.la/274928)\n\n- Toolkit chrome registry\n\n - : Chrome registration has been significantly improved to use simple plaintext chrome registration manifests, and no longer keeps the chrome.rdf/overlayinfo cache.\n See [Chrome Registration](/en-US/docs/Mozilla/Chrome_Registration).\n\n- Extension Manager\n\n - : Following are the new features:\n - It is now possible to have Extensions outside the profile and application Extensions directories.\n - Installing extensions can now be done by dropping an XPI into the profile or application Extensions directory.\n - Uninstalling an Extension now involves deleting its folder from the profile or application Extensions directory.\n\n- New Preferences bindings\n\n - : These [new bindings](https://forums.mozillazine.org/viewtopic.php?t=263028) make it easier to create preferences windows for extensions. The new preferences windows support instant-apply behavior, which is enabled by default on Mac and Linux.\n\n- API for implementing new command-line switches\n\n - : An API has been introduced so that extensions can easily handle complex command-line flags. This API will be stable and frozen for 1.1. See the interfaces `nsICommandLine` and `nsICommandLineHandler`.\n\n- XTF Support\n - : The eXtensible Tag Framework allows adding support for new namespaces using XPCOM components to Mozilla (written in JavaScript or C++). See [XTF Home Page](https://web.archive.org/web/20070527160710/http://www.croczilla.com/xtf).\n\n### New Browser Features\n\n#### Improved Preferences\n\n- Instant Apply behavior on Linux and Mac\n - : Changes made in the Preferences window now apply immediately, in line with typical behavior in other Mac OS X and GNOME applications. This changes conforms with the Apple and GNOME Human Interface Guidelines.\n- Searchable download actions manager\n - : It is possible to search the Download Actions manager by file extension or description.\n- Searchable cookie manager\n - : Cookies can be searched by hostname/domain and cookie name, and are organized by hostname in a tree format instead of a flat list.\n\n#### Deployment\n\n- Firefox MSI package\n - : The new MSI installation package facilitates distributed installation and provides greater flexibility to network administrators wanting to deploy Firefox in a corporate environment.\n- Support for profile \"temp\" directory on local filesystem\n - : It is now possible to store the network cache (copies of visited webpages) and the XUL fastload cache (precompiled user interface code) on a local disk, while keeping the rest of the profile data on a network drive. This will increase performance and reduce network traffic for users in a network environment.\n\n#### Other\n\n- \"Sanitize\" privacy feature\n - : The \"Sanitize\" feature provides an easy way to quickly remove browsing history, cookies, cache, saved form information, and other personal data. The items to be removed can be customized, and the feature can be activated using either a keyboard shortcut or through a menu item.\n- Image thumbnails as tab icons\n - : When viewing images, tab icons now display thumbnails of the displayed image.\n- Fast back (and forward)\n - : This very experimental feature allows much faster session history navigation. The feature is off by default but can be enabled for testing purposes by setting the `browser.sessionhistory.max_viewers` preference to a nonzero number.\n- Anonymous FTP login failure behavior\n - : FTP users are now prompted to input a name and password if anonymous access fails.\n- CSS at-rule for matching on site/document URL\n - : The new `@-moz-document` rule gives users the ability to match page objects per-site, using CSS. This makes it possible to include site-specific rules in user style sheets (userContent.css). [David Baron's post to `www-style`](https://lists.w3.org/Archives/Public/www-style/2004Aug/0135.html) explains how the rule can be used.\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":8280,"cells":{"repo_id":{"kind":"string","value":"data/mdn-content/files/en-us/mozilla/firefox/releases/1.5"},"file_path":{"kind":"string","value":"data/mdn-content/files/en-us/mozilla/firefox/releases/1.5/changing_the_priority_of_http_requests/index.md"},"content":{"kind":"string","value":"---\ntitle: Changing the Priority of HTTP Requests (Non-Standard)\nslug: Mozilla/Firefox/Releases/1.5/Changing_the_priority_of_HTTP_requests\npage-type: guide\n---\n\n{{FirefoxSidebar}}\n\n> **Warning:** The approach described in this topic is non-standard, and not recommended.\n>\n> The best way to request resources over HTTP is to use [`fetch()`](/en-US/docs/Web/API/fetch), which allows you to specify the priority in [`Request.priority`](/en-US/docs/Web/API/Request/priority).\n> You can also set the HTTP priority on [`HTMLLinkElement`](/en-US/docs/Web/API/HTMLLinkElement/fetchPriority), [`HTMLIFrameElement`](/en-US/docs/Web/API/HTMLIFrameElement), and [`HTMLImageElement`](/en-US/docs/Web/API/HTMLImageElement/fetchPriority) elements (and associated tags) using the `fetchpriority` attribute.\n\nIn [Firefox 1.5](/en-US/docs/Mozilla/Firefox/Releases/1.5), an API was added to support changing the priority of [HTTP](/en-US/docs/Web/HTTP) requests. Prior to this, there was no way to directly indicate that a request was of a different priority. The API is defined in `nsISupportsPriority`, but is defined in very generic terms so that any object can implement this interface to enable the concept of priority. This article deals specifically with using that interface to change the priority of HTTP requests.\n\nAt the time of this writing, changing the priority of an HTTP request only affects the order in which connection attempts are made. This means that the priority only has an effect when there are more connections (to a server) than are allowed.\n\nThe examples in this document are all written in [JavaScript](/en-US/docs/Web/JavaScript) using XPCOM.\n\nIt should be noted that the value of the `priority` attribute follows UNIX conventions, with smaller numbers (including negative numbers) having higher priority.\n\n## Accessing priority from an nsIChannel\n\nTo change the priority of an HTTP request, you need access to the `nsIChannel` that the request is being made on. If you do not have an existing channel, then you can create one as follows:\n\n```js\nvar ios = Components.classes[\"@mozilla.org/network/io-service;1\"].getService(\n Components.interfaces.nsIIOService,\n);\nvar ch = ios.newChannel(\"https://www.example.com/\", null, null);\n```\n\nOnce you have an `nsIChannel`, you can access the priority as follows:\n\n```js\nif (ch instanceof Components.interfaces.nsISupportsPriority) {\n ch.priority = Components.interfaces.nsISupportsPriority.PRIORITY_LOWEST;\n}\n```\n\nFor convenience, the interface defines several standard priority values that you can use, ranging from `PRIORITY_HIGHEST` to `PRIORITY_LOWEST`.\n\n## Getting an nsIChannel from XMLHttpRequest\n\nIf you are programming in [JavaScript](/en-US/docs/Web/JavaScript), you will probably want to use [XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest), a much higher level abstraction of an HTTP request. You can access the `channel` member of an [XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest) once you have called the `open` method on it, as follows:\n\n```js\nvar req = new XMLHttpRequest();\nreq.open(\"GET\", \"https://www.example.com\", false);\nif (req.channel instanceof Components.interfaces.nsISupportsPriority) {\n req.channel.priority =\n Components.interfaces.nsISupportsPriority.PRIORITY_LOWEST;\n}\nreq.send(null);\n```\n\n> **Note:** This example uses a synchronous [XMLHttpRequest](/en-US/docs/Web/API/XMLHttpRequest), which you should not use in practice.\n\n## Adjusting priority\n\n`nsISupportsPriority` includes a convenience method named `adjustPriority`. You should use this if you want to alter the priority of a request by a certain amount. For example, if you would like to make a request have slightly higher priority than it currently has, you could do the following:\n\n```js\n// assuming we already have a nsIChannel from above\nif (ch instanceof Components.interfaces.nsISupportsPriority) {\n ch.adjustPriority(-1);\n}\n```\n\nRemember that lower numbers mean higher priority, so adjusting by a negative number will serve to increase the request's priority.\n"},"__index_level_0__":{"kind":"number","value":0,"string":"0"}}},{"rowIdx":8281,"cells":{"repo_id":{"kind":"string","value":"data/mdn-content/files/en-us/mozilla/firefox/releases"},"file_path":{"kind":"string","value":"data/mdn-content/files/en-us/mozilla/firefox/releases/53/index.md"},"content":{"kind":"string","value":"---\ntitle: Firefox 53 for developers\nslug: Mozilla/Firefox/Releases/53\npage-type: firefox-release-notes\n---\n\n{{FirefoxSidebar}}\n\nFirefox 53 was released on April 19, 2017. This article lists key changes that are useful not only for web developers but also for Firefox and Gecko developers, as well as add-on developers.\n\n## Changes for Web developers\n\n### Developer Tools\n\n- Avoid scrolling latency on highlighters given by APZ ([Firefox bug 1312103](https://bugzil.la/1312103)).\n- Added option to [copy the full CSS path](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_and_edit_html/index.html#copy-css-path) of an element ([Firefox bug 1323700](https://bugzil.la/1323700)).\n- Devtools support for css-color-4 ([Firefox bug 1310681](https://bugzil.la/1310681)).\n- Markup view: add a visual hint between opening and closing tags of a collapsed node ([Firefox bug 1323193](https://bugzil.la/1323193)).\n\n### CSS\n\n#### New features\n\n- The `mask-*` longhand properties (see [CSS Masks](/en-US/docs/Web/CSS/CSS_masking)) are all supported and available by default (see [Firefox bug 1251161](https://bugzil.la/1251161)).\n- Added {{cssxref(\"caret-color\")}} property ([Firefox bug 1063162](https://bugzil.la/1063162)).\n- Implemented the {{cssxref(\"place-items\")}}/{{cssxref(\"place-self\")}}/{{cssxref(\"place-content\")}} shorthands ([Firefox bug 1319958](https://bugzil.la/1319958)).\n- Added `flow-root` value to {{cssxref(\"display\")}} property ([Firefox bug 1322191](https://bugzil.la/1322191)).\n- {{cssxref(\"tab-size\", \"-moz-tab-size\")}} now accepts {{cssxref(\"<length>\")}} values ([Firefox bug 943918](https://bugzil.la/943918)), and is now animatable ([Firefox bug 1308110](https://bugzil.la/1308110)).\n- {{cssxref(\"mask-mode\")}}:luminance doesn't work on gradient masks ([Firefox bug 1346265](https://bugzil.la/1346265)).\n- \\[css-grid] FR Unit in {{cssxref(\"grid-template-rows\")}} not filling viewport ([Firefox bug 1346699](https://bugzil.la/1346699)).\n- flex items aren't sorted according to \"order\", if they're separated by an abspos sibling ([Firefox bug 1345873](https://bugzil.la/1345873)).\n\n#### Other changes\n\n- Enable mask longhands on SVG elements ([Firefox bug 1319667](https://bugzil.la/1319667)).\n- \\[css-grid] Fixed: `align-self`/`justify-self:stretch`/`normal` doesn't work on `` grid items ([Firefox bug 1316051](https://bugzil.la/1316051)).\n- Fixed: `clip-path: circle()` with large reference box and percentage radius does not render correctly ([Firefox bug 1324713](https://bugzil.la/1324713).\n- When applying a {{cssxref(\"text-transform\")}} value of `uppercase` to Greek text, the accent on the disjunctive eta (ή) is no longer removed (see [Firefox bug 1322989](https://bugzil.la/1322989)).\n- The availability of the `contents` value of {{cssxref(\"display\")}} was controlled through the `layout.css.display-contents.enabled` pref. In Firefox 53, this pref has been removed altogether, so the value will always be available and can no longer be disabled ([Firefox bug 1295788](https://bugzil.la/1295788)).\n\n### JavaScript\n\n- ECMAScript 2015 semantics for the {{jsxref(\"Function.name\")}} properties have been implemented. This includes inferred names on anonymous functions (`var foo = function() {}`) ([Firefox bug 883377](https://bugzil.la/883377)).\n- ECMAScript 2015 semantics for closing iterators have been implemented. This affects the [`for...of`](/en-US/docs/Web/JavaScript/Reference/Statements/for...of) loop, for example ([Firefox bug 1147371](https://bugzil.la/1147371)).\n- The [Template Literal Revision proposal](https://tc39.es/proposal-template-literal-revision/) that [lifts escape sequence restrictions on tagged template literals](/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates_and_escape_sequences) has been implemented ([Firefox bug 1317375](https://bugzil.la/1317375)).\n- The static `length` property of {{jsxref(\"TypedArray\")}} objects was changed from 3 to 0 as per ES2016 ([Firefox bug 1317306](https://bugzil.la/1317306)).\n- {{jsxref(\"SharedArrayBuffer\")}} can now be used in {{jsxref(\"DataView\")}} objects ([Firefox bug 1246597](https://bugzil.la/1246597)).\n- In earlier versions of the specification, {{jsxref(\"SharedArrayBuffer\")}} objects needed to be explicitly transferred during [structured cloning](/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). In the new specification, they aren't [transferable objects](/en-US/docs/Web/API/Web_Workers_API/Transferable_objects) anymore and thus must not be in the transfer list. The new behavior used to present a console warning only, but will now throw an error ([Firefox bug 1302037](https://bugzil.la/1302037)).\n- The {{jsxref(\"ArrayBuffer\")}} length is now limited to {{jsxref(\"Number.MAX_SAFE_INTEGER\")}} (>= 2 \\*\\* 53) ([Firefox bug 1255128](https://bugzil.la/1255128)).\n- {{jsxref(\"Error\")}} and other native error object prototypes like {{jsxref(\"RangeError\")}} etc. are now ordinary objects instead of proper Error objects. (In particular, `Object.prototype.toString.call(Error.prototype)` is now `\"[object Object]\"` instead of `\"[object Error]\"`.) ([Firefox bug 1213341](https://bugzil.la/1213341)).\n\n### Events\n\n- CSS Transitions: The {{domxref(\"Element/transitionstart_event\", \"transitionstart\")}}, {{domxref(\"Element/transitionrun_event\", \"transitionrun\")}}, and {{domxref(\"Element/transitioncancel_event\", \"transitioncancel\")}} events have been implemented (see [Firefox bug 1264125](https://bugzil.la/1264125) and [Firefox bug 1287983](https://bugzil.la/1287983)).\n- The {{domxref(\"CompositionEvent.CompositionEvent\", \"CompositionEvent\")}} constructor has been implemented (see [Firefox bug 1002256](https://bugzil.la/1002256)).\n- The {{domxref(\"MouseEvent.x\")}} and {{domxref(\"MouseEvent.y\")}} aliases of {{domxref(\"MouseEvent.clientX\")}}/{{domxref(\"MouseEvent.clientY\")}} have been implemented (see [Firefox bug 424390](https://bugzil.la/424390)).\n- The {{domxref(\"Element/auxclick_event\", \"auxclick\")}} event and corresponding event handler have been implemented (see [Firefox bug 1304044](https://bugzil.la/1304044)).\n- The {{domxref(\"Element/transitioncancel_event\", \"transitioncancel\")}} event is now fired after a [transition](/en-US/docs/Web/CSS/CSS_transitions) is cancelled.\n\n### DOM\n\n- The {{domxref(\"HTMLAnchorElement/pathname\", \"pathname\")}} and {{domxref(\"HTMLAnchorElement/search\", \"search\")}} properties of links (like for {{HTMLElement(\"a\")}} and {{HTMLELement(\"link\")}} elements' interfaces previously returned the wrong parts of the URL. For example, for a URL of `http://z.com/x?a=true&b=false`, `pathname` would return \"`/x?a=true&b=false\"` and `search` would return \"\", rather than \"`/x`\" and \"`?a=true&b=false\"` respectively. This has now been fixed ([Firefox bug 1310483](https://bugzil.la/1310483)).\n- The {{domxref(\"URLSearchParams.URLSearchParams\", \"URLSearchParams()\")}} constructor now accepts a string or sequence of strings as an init object ([Firefox bug 1330678](https://bugzil.la/1330678)).\n- The {{domxref(\"Selection.setBaseAndExtent()\")}} method of the [Selection API](/en-US/docs/Web/API/Selection) is now implemented (see [Firefox bug 1321623](https://bugzil.la/1321623)).\n- The [\"fakepath\"](https://html.spec.whatwg.org/multipage/forms.html#fakepath-srsly) addition to `file` type {{htmlelement(\"input\")}} `values` has been implemented in Gecko, giving it parity with other browsers (see [Firefox bug 1274596](https://bugzil.la/1274596)).\n- {{domxref(\"Node.getRootNode()\")}} has been implemented, replacing the deprecated `Node.rootNode` property ([Firefox bug 1269155](https://bugzil.la/1269155)).\n- Own properties of {{domxref(\"Plugin\")}} and {{domxref(\"PluginArray\")}} objects are no longer enumerable ([Firefox bug 1270366](https://bugzil.la/1270366)).\n- Named properties of {{domxref(\"MimeTypeArray\")}} objects are no longer enumerable ([Firefox bug 1270364](https://bugzil.la/1270364)).\n- The [Permissions API](/en-US/docs/Web/API/Permissions_API) now has a new permission name available — `persistent-storage` — as used when making a {{domxref(\"Permissions.query()\")}} (see [Firefox bug 1270038](https://bugzil.la/1270038)). This allows an origin to use a persistent box (i.e., [persistent storage](https://storage.spec.whatwg.org/#persistence)) for its storage, as per the [Storage API](https://storage.spec.whatwg.org/).\n- The {{domxref(\"Performance.timeOrigin\")}} property has been implemented ([Firefox bug 1313420](https://bugzil.la/1313420)).\n\n### Workers and service workers\n\n- The [Network Information API](/en-US/docs/Web/API/Network_Information_API) is now available in workers (see [Firefox bug 1323172](https://bugzil.la/1323172)).\n- [Server-sent events](/en-US/docs/Web/API/Server-sent_events) can now be used in workers (see [Firefox bug 1267903](https://bugzil.la/1267903)).\n- {{domxref(\"ExtendableEvent.waitUntil\", \"ExtendableEvent.waitUntil()\")}} can now be called asynchronously (see [Firefox bug 1263304](https://bugzil.la/1263304)).\n\n### WebGL\n\n- The {{domxref(\"WEBGL_compressed_texture_astc\")}} WebGL extension has been implemented ([Firefox bug 1250077](https://bugzil.la/1250077)).\n- The {{domxref(\"WEBGL_debug_renderer_info\")}} WebGL extension is now enabled by default ([Firefox bug 1336645](https://bugzil.la/1336645)).\n\n### Audio, video, and media\n\n#### General\n\n- Beginning in **Firefox 53 for Android**, decoding of media is handled out-of-process for improved performance on multi-core systems ([Firefox bug 1333323](https://bugzil.la/1333323)).\n\n#### Media elements\n\n- The {{domxref(\"HTMLMediaElement.play()\")}} method, used to begin playback of media in any media element, now returns a {{jsxref(\"Promise\")}} which is fulfilled when playback begins and is rejected if an error occurs ([Firefox bug 1244768](https://bugzil.la/1244768)).\n\n#### Web Audio API\n\n- The {{domxref(\"AudioScheduledSourceNode\")}} interface has been added and the {{domxref(\"AudioBufferSourceNode\")}}, {{domxref(\"ConstantSourceNode\")}}, and {{domxref(\"OscillatorNode\")}} interfaces are now based on it ([Firefox bug 1324568](https://bugzil.la/1324568)).\n- All the different audio node types have had constructors added to them ([Firefox bug 1322883](https://bugzil.la/1322883)).\n\n#### WebRTC\n\n- The {{domxref(\"RTCPeerConnection\")}} methods {{domxref(\"RTCPeerConnection.createOffer\", \"createOffer()\")}} and {{domxref(\"RTCPeerConnection.createAnswer\", \"createAnswer()\")}} now return a {{jsxref(\"Promise\")}} that returns an object conforming to the `RTCSessionDescriptionInit` dictionary instead of returning an {{domxref(\"RTCSessionDescription\")}} directly. Existing code will continue to work, but new code can be written more simply.\n- Similarly, the {{domxref(\"RTCPeerConnection\")}} methods {{domxref(\"RTCPeerConnection.setLocalDescription\", \"setLocalDescription()\")}} and {{domxref(\"RTCPeerConnection.setRemoteDescription\", \"setRemoteDescription()\")}} now accept as input an object conforming to the dictionary `RTCSessionDescriptionInit` dictionary. Existing code continues to work, but [can be simplified](/en-US/docs/Web/API/RTCPeerConnection/setLocalDescription#about_the_session_description_parameter).\n- {{domxref(\"RTCPeerConnection.addIceCandidate()\")}} now accepts as input an initialization object. This is compatible with existing code but allows new code to be written slightly more simply when used in tandem with the changes listed above ([Firefox bug 1263312](https://bugzil.la/1263312)).\n- {{Glossary(\"DTMF\")}} support is now enabled by default using {{domxref(\"RTCDTMFSender\")}}. See [Using DTMF with WebRTC](/en-US/docs/Web/API/WebRTC_API/Using_DTMF) for more information on how this works.\n\n### HTTP/Networking\n\n- Gecko now has a pref available in `about:config` to allow users to set their default {{HTTPHeader(\"Referrer-Policy\")}} — `network.http.referer.userControlPolicy` ([Firefox bug 1304623](https://bugzil.la/1304623)). Possible values are:\n\n - 0 — `no-referrer`\n - 1 — `same-origin`\n - 2 — `strict-origin-when-cross-origin`\n - 3 — `no-referrer-when-downgrade` (the default)\n\n- Support for Next Protocol Negotiation (NPN) has been removed in favor of [Application-Layer Protocol Negotiation](https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation) (ALPN) — see [Firefox bug 1248198](https://bugzil.la/1248198).\n- The {{httpheader(\"Large-Allocation\")}} HTTP header is now available by default, and no longer hidden behind a pref ([Firefox bug 1331083](https://bugzil.la/1331083)).\n\n### SVG\n\n- Partly implemented {{domxref(\"SVGGeometryElement\")}} interface ([Firefox bug 1239100](https://bugzil.la/1239100)).\n\n## Removals from the web platform\n\n### HTML/XML\n\n- The `dom.details_element.enabled` pref — which controlled enabling/disabling {{htmlelement(\"details\")}} and {{htmlelement(\"summary\")}} element support in Firefox — has now been removed from `about:config`. These elements (first enabled by default in Firefox 49) can no longer be disabled. See [Firefox bug 1271549](https://bugzil.la/1271549).\n- The `mozapp` attribute of the {{htmlelement(\"iframe\")}} element /{{domxref(\"HTMLIFrameElement\")}} interface has been removed — this was used to enable a Firefox OS app to be embedded in a mozilla-prefixed Browser API `