Skip to content

Commit

Permalink
Release build 7.2.0 [ci release]
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane authored and github-actions[bot] committed Nov 14, 2024
1 parent c5603a8 commit 757bbba
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 40 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jobs:
else
git checkout -b releases
fi
- name: Collect commit ranges
run: |
Expand Down
11 changes: 3 additions & 8 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
- fix release flow
- Remove artifacts from 'main' (#227)
- Add config to ignore linting PRs (#224)
- Consistent Prettier config (#222)
- Bump typedoc from 0.26.8 to 0.26.11 (#199)
- Shared eslint config (#198)
- Adds JSON example to Toggle Report guide (#197)
- Grey out icons depending on phishingStatus (#195)
- windows interop messaging (#228)
- prettier
- add netlify file
12 changes: 6 additions & 6 deletions build/app/public/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -14654,8 +14654,8 @@
resolveInitialRender3();
}
function windowsPostMessage(name, data) {
assert(typeof window.chrome.webview?.postMessage === "function");
window.chrome.webview.postMessage({
assert(typeof globalThis.windowsInteropPostMessage === "function");
globalThis.windowsInteropPostMessage({
Feature: "PrivacyDashboard",
Name: name,
Data: data
Expand Down Expand Up @@ -14761,13 +14761,13 @@
}
}
function setup5() {
if (!window.chrome.webview) {
console.error("window.chrome.webview not available");
if (!globalThis.windowsInteropPostMessage) {
console.error("globalThis.windowsInteropPostMessage");
return;
}
setupColorScheme();
assert(typeof window.chrome.webview?.addEventListener === "function", "window.chrome.webview.addEventListener is required");
window.chrome.webview.addEventListener("message", (event) => {
assert(typeof globalThis.windowsInteropAddEventListener === "function", "globalThis.windowsInteropAddEventListener required");
globalThis.windowsInteropAddEventListener("message", (event) => {
handleIncomingMessage(event.data);
});
setupMutationObserver((height) => {
Expand Down
2 changes: 2 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
ignore = "git log -1 --pretty=%B | grep dependabot"
15 changes: 5 additions & 10 deletions shared/js/browser/utils/communication-mocks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,12 @@ export function windowsMockApis() {
},
calls: [],
};
// override some methods on window.chrome.runtime to fake the incoming/outgoing messages
window.chrome.webview = {
// @ts-ignore
addEventListener: (messageName, listener) => {
window.__playwright.listeners?.push(listener);
},
postMessage(arg) {
window.__playwright.mocks.outgoing.push([arg.Name, arg]);
},
globalThis.windowsInteropAddEventListener = (messageName, listener) => {
window.__playwright.listeners?.push(listener);
};
globalThis.windowsInteropPostMessage = (arg) => {
window.__playwright.mocks.outgoing.push([arg.Name, arg]);
};
// console.log('window.chrome.webview', window.chrome.webview)
} catch (e) {
console.error("❌couldn't set up mocks");
console.error(e);
Expand Down
30 changes: 15 additions & 15 deletions shared/js/browser/windows-communication.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* The Dashboard receives data from Windows by registering a listener on `window.chrome.webview`
*
* ```js
* window.chrome.webview.addEventListener('message', (event) => handleViewModelUpdate(event.data))
* globalThis.windowsInteropAddEventListener('message', (event) => handleViewModelUpdate(event.data))
* ```
*
* Tip: See {@link "Windows integration".handleIncomingMessage} for details of supported messages.
Expand All @@ -15,7 +15,7 @@
* When the dashboard needs to communicate back to the Windows application, it will do so in the following way...
*
* ```js
* window.chrome.webview.postMessage({
* globalThis.windowsInteropPostMessage({
* Feature: 'PrivacyDashboard',
* Name: name,
* Data: data
Expand Down Expand Up @@ -96,7 +96,7 @@ const resolveInitialRender = function () {
* @example
*
* ```js
* window.chrome.webview.addEventListener('message', event => handleViewModelUpdate(event.data))
* globalThis.windowsInteropAddEventListener('message', event => handleViewModelUpdate(event.data))
* ```
*
* @param {import('../../../schema/__generated__/schema.types').WindowsViewModel} viewModel
Expand All @@ -121,8 +121,8 @@ function handleViewModelUpdate(viewModel) {
// -----------------------------------------------------------------------------

function windowsPostMessage(name, data) {
assert(typeof window.chrome.webview?.postMessage === 'function');
window.chrome.webview.postMessage({
assert(typeof globalThis.windowsInteropPostMessage === 'function');
globalThis.windowsInteropPostMessage({
Feature: 'PrivacyDashboard',
Name: name,
Data: data,
Expand Down Expand Up @@ -190,7 +190,7 @@ async function fetch(message) {
* @example
*
* ```javascript
* window.chrome.webview.postMessage({
* globalThis.windowsInteropPostMessage({
* Feature: 'PrivacyDashboard',
* Name: 'SubmitBrokenSiteReport',
* Data: { category: "videos", description: "something was broken :(" }
Expand All @@ -212,7 +212,7 @@ export function SubmitBrokenSiteReport(report) {
* @example
*
* ```javascript
* window.chrome.webview.postMessage({
* globalThis.windowsInteropPostMessage({
* Feature: 'PrivacyDashboard',
* Name: 'OpenInNewTab',
* Data: { url: "https://example.com" }
Expand All @@ -233,7 +233,7 @@ export function OpenInNewTab(args) {
* @example
*
* ```javascript
* window.chrome.webview.postMessage({
* globalThis.windowsInteropPostMessage({
* Feature: 'PrivacyDashboard',
* Name: 'SetSize',
* Data: { height: 445 }
Expand All @@ -252,7 +252,7 @@ export function SetSize(payload) {
* @example
*
* ```javascript
* window.chrome.webview.postMessage({
* globalThis.windowsInteropPostMessage({
* Feature: 'PrivacyDashboard',
* Name: 'OpenSettings',
* Data: { target: 'cpm' }
Expand All @@ -271,7 +271,7 @@ export function OpenSettings(args) {
* @example
*
* ```javascript
* window.chrome.webview.postMessage({
* globalThis.windowsInteropPostMessage({
* Feature: 'PrivacyDashboard',
* Name: 'SetPermissionCommand',
* Data: { permission: 'camera', value: "grant" }
Expand Down Expand Up @@ -327,7 +327,7 @@ const getBackgroundTabData = () => {
const eventShape = z.discriminatedUnion('Name', [windowsIncomingViewModelSchema, windowsIncomingVisibilitySchema]);

/**
* Handle all messages sent from Windows via `window.chrome.webview.addEventListener`
* Handle all messages sent from Windows via `globalThis.windowsInteropAddEventListener`
*
* Currently accepted messages:
* - {@link "Generated Schema Definitions".WindowsIncomingViewModel}
Expand Down Expand Up @@ -357,13 +357,13 @@ export function handleIncomingMessage(message) {
}

export function setup() {
if (!window.chrome.webview) {
console.error('window.chrome.webview not available');
if (!globalThis.windowsInteropPostMessage) {
console.error('globalThis.windowsInteropPostMessage');
return;
}
setupColorScheme();
assert(typeof window.chrome.webview?.addEventListener === 'function', 'window.chrome.webview.addEventListener is required');
window.chrome.webview.addEventListener('message', (event) => {
assert(typeof globalThis.windowsInteropAddEventListener === 'function', 'globalThis.windowsInteropAddEventListener required');
globalThis.windowsInteropAddEventListener('message', (event) => {
handleIncomingMessage(event.data);
});
setupMutationObserver((height) => {
Expand Down

0 comments on commit 757bbba

Please sign in to comment.