Release Vulpes OS 2.7-preview.24
This commit is contained in:
parent
49572b6b45
commit
97ef99f827
135 changed files with 7717 additions and 2524 deletions
|
|
@ -30,9 +30,14 @@
|
|||
const next = state.battery;
|
||||
if (next && Number.isFinite(next.level) && next.level >= 0 && next.level <= 1) {
|
||||
const oldLevel = battery.level, oldCharging = battery.charging;
|
||||
const oldChargingTime = battery.chargingTime, oldDischargingTime = battery.dischargingTime;
|
||||
battery.level = next.level; battery.charging = !!next.charging;
|
||||
battery.chargingTime = Number.isFinite(next.chargingTime) && next.chargingTime > 0 ? next.chargingTime : Infinity;
|
||||
battery.dischargingTime = Number.isFinite(next.dischargingTime) && next.dischargingTime > 0 ? next.dischargingTime : Infinity;
|
||||
if (oldLevel !== battery.level) battery.dispatchEvent(new Event('levelchange'));
|
||||
if (oldCharging !== battery.charging) battery.dispatchEvent(new Event('chargingchange'));
|
||||
if (oldChargingTime !== battery.chargingTime) battery.dispatchEvent(new Event('chargingtimechange'));
|
||||
if (oldDischargingTime !== battery.dischargingTime) battery.dispatchEvent(new Event('dischargingtimechange'));
|
||||
}
|
||||
} catch (_) { /* An unknown battery is not an empty battery. */ }
|
||||
}
|
||||
|
|
@ -278,6 +283,12 @@
|
|||
if (location.hostname==='system.localhost') addEventListener('mozContentEvent', event=>{
|
||||
if (event.detail?.type==='activity-choice')
|
||||
call('activities.select',{id:event.detail.id,value:event.detail.value}).catch(console.error);
|
||||
if (event.detail?.type==='take-screenshot')
|
||||
call('system.screenshot',{}).then(file=>dispatchEvent(new CustomEvent('mozChromeEvent',{
|
||||
detail:{type:'take-screenshot-success',file}
|
||||
}))).catch(error=>dispatchEvent(new CustomEvent('mozChromeEvent',{
|
||||
detail:{type:'take-screenshot-error',error:error.message || 'SCREENSHOT_FAILED'}
|
||||
})));
|
||||
});
|
||||
function application(record) {
|
||||
// DOMApplication never exposed the registry's internal id. Gaia uses `id`
|
||||
|
|
@ -412,6 +423,12 @@
|
|||
navigator.mozHasPendingMessage = name => name === 'activity' && (new URLSearchParams(location.search).has('activity') || /\/(pick|share)\.html$/.test(location.pathname));
|
||||
navigator.mozSetMessageHandlerPromise = (promise) => promise;
|
||||
window.VulpesCompat = { call, request, handlers };
|
||||
// Cost Control calls window.close() after its SIM-ready error dialog.
|
||||
// Desktop and Android use Gaia's in-app task switcher, so close the app
|
||||
// through the privileged host bridge instead of leaving the dialog stuck.
|
||||
if (location.hostname === 'costcontrol.localhost') {
|
||||
window.close = () => call('apps.close', {}).catch(console.error);
|
||||
}
|
||||
window.MozActivity = function (source) {
|
||||
return request(call('activities.start', source));
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue