From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- .../android-components/docs/_includes/header.html | 34 ++--- .../docs/_includes/post_detail.html | 22 ++-- .../android-components/docs/_layouts/post.html | 61 +++++---- .../android-components/docs/assets/js/icon-js.js | 145 +++++++++++---------- .../android/android-components/docs/changelog.md | 27 +++- 5 files changed, 170 insertions(+), 119 deletions(-) (limited to 'mobile/android/android-components/docs') diff --git a/mobile/android/android-components/docs/_includes/header.html b/mobile/android/android-components/docs/_includes/header.html index 7a989f7de9..b32fc0298d 100644 --- a/mobile/android/android-components/docs/_includes/header.html +++ b/mobile/android/android-components/docs/_includes/header.html @@ -2,22 +2,24 @@
-
diff --git a/mobile/android/android-components/docs/_includes/post_detail.html b/mobile/android/android-components/docs/_includes/post_detail.html index bceb37d5bc..2cb5a8a9cd 100644 --- a/mobile/android/android-components/docs/_includes/post_detail.html +++ b/mobile/android/android-components/docs/_includes/post_detail.html @@ -1,16 +1,16 @@

- +

diff --git a/mobile/android/android-components/docs/_layouts/post.html b/mobile/android/android-components/docs/_layouts/post.html index 29f841f336..cf3d23a3c5 100644 --- a/mobile/android/android-components/docs/_layouts/post.html +++ b/mobile/android/android-components/docs/_layouts/post.html @@ -1,38 +1,53 @@ --- layout: default --- -
+
-

{{ page.title | escape }}

+

+ {{ page.title | escape }} +

-
- {{ content }} -
+
{{ content }}
- {%- if site.disqus.shortname -%} - {%- include disqus_comments.html -%} - {%- endif -%} + {%- if site.disqus.shortname -%} {%- include disqus_comments.html -%} {%- + endif -%}
diff --git a/mobile/android/android-components/docs/assets/js/icon-js.js b/mobile/android/android-components/docs/assets/js/icon-js.js index 6c5ca1a226..41ace3daf7 100644 --- a/mobile/android/android-components/docs/assets/js/icon-js.js +++ b/mobile/android/android-components/docs/assets/js/icon-js.js @@ -3,11 +3,11 @@ * @return {Element} */ function htmlToElement(html) { - let template = document.createElement('template'); - html = html.trim(); // Never return a text node of whitespace as the result - template.innerHTML = html; - //firstChild may be a comment so we must use firstElementChild to avoid picking it - return template.content.firstElementChild; + let template = document.createElement("template"); + html = html.trim(); // Never return a text node of whitespace as the result + template.innerHTML = html; + //firstChild may be a comment so we must use firstElementChild to avoid picking it + return template.content.firstElementChild; } /** @@ -17,81 +17,90 @@ function htmlToElement(html) { * @returns {String} The same string but in the standard SVG representation */ function androidSVGtoNormalSVG(s) { - s = s.replace(/<\?xml version="1\.0" encoding="utf-8"\?>/g, ''); - s = s.replace(//g, ''); - s = s.replace(/android:(height|width)="(\d+)dp"/g, ''); - s = s.replace(/android:viewportHeight="(\d+\.?\d+)"/g, 'height="$1"'); - s = s.replace(/android:viewportWidth="(\d+\.?\d+)"/g, 'width="$1"'); - s = s.replace(/android:fillColor=/g, 'fill='); - s = s.replace(/android:pathData=/g, 'd='); - //s = s.replace(/android:/g, ''); - return s; + s = s.replace(/<\?xml version="1\.0" encoding="utf-8"\?>/g, ""); + s = s.replace( + //g, ""); + s = s.replace(/android:(height|width)="(\d+)dp"/g, ""); + s = s.replace(/android:viewportHeight="(\d+\.?\d+)"/g, 'height="$1"'); + s = s.replace(/android:viewportWidth="(\d+\.?\d+)"/g, 'width="$1"'); + s = s.replace(/android:fillColor=/g, "fill="); + s = s.replace(/android:pathData=/g, "d="); + //s = s.replace(/android:/g, ''); + return s; } function addToTable(name, svg) { - let table = document.querySelector("#preview_table > tbody"); - let row = htmlToElement(""); - row.appendChild(htmlToElement("" + name + "")); - let td = htmlToElement(""); - td.appendChild(svg); - row.appendChild(td); - table.appendChild(row); + let table = document.querySelector("#preview_table > tbody"); + let row = htmlToElement(""); + row.appendChild(htmlToElement("" + name + "")); + let td = htmlToElement(""); + td.appendChild(svg); + row.appendChild(td); + table.appendChild(row); } function addSingleItemToTable(str) { - let table = document.querySelector("#preview_table > tbody"); - table.append(htmlToElement("" + str + "")) + let table = document.querySelector("#preview_table > tbody"); + table.append(htmlToElement("" + str + "")); } function getFile(iconName, downloadUrl) { - return new Promise((resolve, reject) => { - let request = new XMLHttpRequest(); - request.open('GET', downloadUrl, true); - request.onreadystatechange = function () { - if (request.readyState === 4 && request.status === 200) { - let androidXmlText = request.responseText; - androidXmlText = androidSVGtoNormalSVG(androidXmlText); - resolve([iconName, androidXmlText]); - } else if (request.readyState === 4) { - //Request completed with an error - resolve([iconName, "Error during download"]); - } - }; - request.send(null); - }); - + return new Promise((resolve, reject) => { + let request = new XMLHttpRequest(); + request.open("GET", downloadUrl, true); + request.onreadystatechange = function () { + if (request.readyState === 4 && request.status === 200) { + let androidXmlText = request.responseText; + androidXmlText = androidSVGtoNormalSVG(androidXmlText); + resolve([iconName, androidXmlText]); + } else if (request.readyState === 4) { + //Request completed with an error + resolve([iconName, "Error during download"]); + } + }; + request.send(null); + }); } // This function recovers all icons inside the drawable folder via github API (function getIcons() { - let request = new XMLHttpRequest(); - request.open("GET", "https://api.github.com/repos/mozilla-mobile/android-components/contents/components/ui/icons/src/main/res/drawable", true); - //Explicit request of the V3 version of the API - request.setRequestHeader("Accept", "application/vnd.github.v3+json"); - request.onreadystatechange = function () { - if (request.readyState === XMLHttpRequest.DONE && request.status === 200) { - let response = JSON.parse(request.response); - if (response.message) { - //Something went wrong - addSingleItemToTable("Error: " + response.message); - return; - } - addSingleItemToTable("Loading"); - let promises = []; - for (let i = 0; i < response.length; i++) { - let iconName = response[i]['name'].substr(0, response[i]['name'].length - 4); - promises.push(getFile(iconName, response[i]['download_url'])); - } - Promise.all(promises).then((values) => { - document.querySelector("#preview_table > tbody").innerHTML = ""; - for (let i = 0; i < values.length; i++) { - let name = values[i][0], svg = values[i][1]; - addToTable(name, htmlToElement(svg)); - } - }); + let request = new XMLHttpRequest(); + request.open( + "GET", + "https://api.github.com/repos/mozilla-mobile/android-components/contents/components/ui/icons/src/main/res/drawable", + true + ); + //Explicit request of the V3 version of the API + request.setRequestHeader("Accept", "application/vnd.github.v3+json"); + request.onreadystatechange = function () { + if (request.readyState === XMLHttpRequest.DONE && request.status === 200) { + let response = JSON.parse(request.response); + if (response.message) { + //Something went wrong + addSingleItemToTable("Error: " + response.message); + return; + } + addSingleItemToTable("Loading"); + let promises = []; + for (let i = 0; i < response.length; i++) { + let iconName = response[i]["name"].substr( + 0, + response[i]["name"].length - 4 + ); + promises.push(getFile(iconName, response[i]["download_url"])); + } + Promise.all(promises).then(values => { + document.querySelector("#preview_table > tbody").innerHTML = ""; + for (let i = 0; i < values.length; i++) { + let name = values[i][0], + svg = values[i][1]; + addToTable(name, htmlToElement(svg)); } - }; - request.send(null); + }); + } + }; + request.send(null); })(); - diff --git a/mobile/android/android-components/docs/changelog.md b/mobile/android/android-components/docs/changelog.md index 6dce7f4966..d14bbca8c8 100644 --- a/mobile/android/android-components/docs/changelog.md +++ b/mobile/android/android-components/docs/changelog.md @@ -4,7 +4,32 @@ title: Changelog permalink: /changelog/ --- -# 126.0 (In Development) +# 127.0 (In Development) + +* **feature-prompts** **browser-storage-sync** + * A new `isLoginAutofillEnabled` callback is available in `PromptFeature` and `GeckoLoginStorageDelegate` to allow clients controlling whether saved logins should be autofilled or not. Default is false + +* **browser-state** + * Added `TabSessionState.getUrl()` extension function that will return the URL that could be + used for various features such as bookmarks or share regardless of the mode the browser is in (e.g. Reader mode). [Bug 1885628](https://bugzilla.mozilla.org/show_bug.cgi?id=1885628). + +* **support-base** + * Added `StartForegroundService` to safely start a foreground service, see [Bug 1839039](https://bugzilla.mozilla.org/show_bug.cgi?id=1839039) for crash reference. + * Added `ProcessInfoProvider` and `BuildVersionProvider` to get information about the app process and the build version. + +* **browser-engine-gecko** + * For screenshot capture, include exception in failure result rather than throwing. + +* **feature-accounts-push** + * 🆕 New `CloseTabsFeature` for closing tabs on this device from other devices that are signed to the same Mozilla account. + * 🆕 New `CloseTabsUseCase` for closing tabs on other devices from this device. + +* **concept-sync** + * 🆕 New `DeviceCapability.CLOSE_TABS` variant to indicate that a device supports closing synced tabs. + * 🆕 New `DeviceCommandIncoming.TabsClosed` variant to represent a "close synced tabs" command received from another device. + * 🆕 New `DeviceCommandOutgoing.CloseTab` variant to represent a "close synced tabs" sent to another device. + +# 126.0 * **browser-menu** * Added enabled state to `BrowserMenuImageText`, see [Bug 1884769](https://bugzilla.mozilla.org/show_bug.cgi?id=1884769). -- cgit v1.2.3