Typescript (Fix bound changes and update child window security) (#628)

* Typescript - Update child window security and permissions

* Typescript - Update bound change logic

* Typescript - Update unit tests

* Typescript - Update aip files and package.json

* Typescript - Fix unit tests for child window handler
This commit is contained in:
Kiran Niranjan 2019-04-08 13:05:14 +05:30 committed by Vishwas Shashidhar
parent f250e1ad30
commit f65fa74057
9 changed files with 136 additions and 67 deletions

View File

@ -294,13 +294,6 @@
}
});
// register callback to be notified when size/position changes for win.
// ssf.registerBoundsChange(onBoundsChange);
function onBoundsChange(arg) {
console.log('bounds changed for=', arg)
}
// crash the renderer process
const crash = document.getElementById('crash');
crash.addEventListener('click', function () {
@ -384,6 +377,20 @@
}
});
/**
* Bound Changes
*/
// register callback to be notified when size/position changes for win.
if (window.ssf) {
ssf.registerBoundsChange(onBoundsChange);
} else {
postMessage(apiCmds.registerBoundsChange);
}
function onBoundsChange(arg) {
console.log('bounds changed for=', arg)
}
/**
* Protocol handler
*/

View File

@ -76,7 +76,7 @@
<ROW Directory="TARGETDIR" DefaultDir="SourceDir"/>
<ROW Directory="app.asar.unpacked_Dir" Directory_Parent="resources_Dir" DefaultDir="APPASA~1.UNP|app.asar.unpacked"/>
<ROW Directory="build_Dir" Directory_Parent="cld_Dir" DefaultDir="build"/>
<ROW Directory="cld_Dir" Directory_Parent="paulcbetts_Dir" DefaultDir="cld"/>
<ROW Directory="cld_Dir" Directory_Parent="nornagon_Dir" DefaultDir="cld"/>
<ROW Directory="config_Dir" Directory_Parent="APPDIR" DefaultDir="config"/>
<ROW Directory="enUS_Dir" Directory_Parent="APPDIR" DefaultDir="en-US"/>
<ROW Directory="frFR_Dir" Directory_Parent="APPDIR" DefaultDir="fr-FR"/>
@ -86,7 +86,7 @@
<ROW Directory="library_Dir" Directory_Parent="APPDIR" DefaultDir="library"/>
<ROW Directory="locales_Dir" Directory_Parent="APPDIR" DefaultDir="locales"/>
<ROW Directory="node_modules_Dir" Directory_Parent="app.asar.unpacked_Dir" DefaultDir="NODE_M~1|node_modules"/>
<ROW Directory="paulcbetts_Dir" Directory_Parent="node_modules_Dir" DefaultDir="@PAULC~1|@paulcbetts"/>
<ROW Directory="nornagon_Dir" Directory_Parent="node_modules_Dir" DefaultDir="@NORNA~1|@nornagon"/>
<ROW Directory="resources_Dir" Directory_Parent="APPDIR" DefaultDir="RESOUR~1|resources"/>
<ROW Directory="spawnrx_Dir" Directory_Parent="node_modules_Dir" DefaultDir="spawn-rx"/>
<ROW Directory="vendor_Dir" Directory_Parent="spawnrx_Dir" DefaultDir="vendor"/>
@ -116,7 +116,7 @@
<ROW Component="am.pak" ComponentId="{76F935B8-6077-4C7A-AD1B-77E2DBA856CC}" Directory_="locales_Dir" Attributes="0" KeyPath="am.pak" Type="0"/>
<ROW Component="appupdate.yml" ComponentId="{F7586760-660A-4C38-8937-138DBEC18D34}" Directory_="resources_Dir" Attributes="0" KeyPath="app.asar" Type="0"/>
<ROW Component="blink_image_resources_200_percent.pak" ComponentId="{56AB17A5-B690-4CBE-A39D-512381AAAFE1}" Directory_="APPDIR" Attributes="0" KeyPath="LICENSES.chromium.html" Type="0"/>
<ROW Component="cld.node" ComponentId="{D9F74D7B-B2E4-4ED8-A023-A54A98AE3F96}" Directory_="Release_Dir" Attributes="256" KeyPath="cld.node" Type="0"/>
<ROW Component="cld.node" ComponentId="{E01D4E00-A44C-4684-802B-64F3C1C0F6E2}" Directory_="Release_Dir" Attributes="256" KeyPath="cld.node" Type="0"/>
<ROW Component="d3dcompiler_47.dll" ComponentId="{C7B87C02-3116-43A8-A70B-3592B70E6AC8}" Directory_="APPDIR" Attributes="256" KeyPath="d3dcompiler_47.dll"/>
<ROW Component="ffmpeg.dll" ComponentId="{A1C4A332-3490-44D8-A5C9-9523889B488B}" Directory_="APPDIR" Attributes="256" KeyPath="ffmpeg.dll"/>
<ROW Component="index.js" ComponentId="{77C48E00-B684-4E72-ACF4-15DD0253EF43}" Directory_="lib_Dir" Attributes="0" KeyPath="index.js" Type="0"/>
@ -125,21 +125,19 @@
<ROW Component="libGLESv2.dll" ComponentId="{0E8B8B21-B4C0-45C9-95D3-637FD93A4EC0}" Directory_="APPDIR" Attributes="256" KeyPath="libGLESv2.dll"/>
<ROW Component="libsymphonysearchx64.dll" ComponentId="{A8C99D17-FA62-4996-8FAE-52D1DCF9BF26}" Directory_="library_Dir" Attributes="256" KeyPath="libsymphonysearchx64.dll"/>
<ROW Component="lz4winx64.exe" ComponentId="{8B78B313-EAE9-4533-AFEB-56F9E0CA73A1}" Directory_="library_Dir" Attributes="256" KeyPath="lz4winx64.exe"/>
<ROW Component="node_modules" ComponentId="{A4EB33A8-FEA8-40A5-94EF-705EBE64DDC1}" Directory_="node_modules_Dir" Attributes="0"/>
<ROW Component="npmignore" ComponentId="{849CFFE2-EBC3-4430-AC8B-DEE1B66DF589}" Directory_="spawnrx_Dir" Attributes="0" KeyPath="COPYING" Type="0"/>
<ROW Component="osmesa.dll" ComponentId="{17DB8D2F-E878-44C3-A363-11DACED0B85D}" Directory_="APPDIR" Attributes="256" KeyPath="osmesa.dll"/>
<ROW Component="tarwin.exe" ComponentId="{4C98F3B1-1A73-4761-86C0-DE0FC18A8800}" Directory_="library_Dir" Attributes="0" KeyPath="tarwin.exe"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">
<ROW Feature="D564007E3BBE4F85950A09B470A7CA65" Title="Visual C++ Redistributable for Visual Studio 2013 x86" Description="Visual C++ Redistributable for Visual Studio 2013 x86" Display="3" Level="1" Attributes="0"/>
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify FreeDiskSpace.exe Jobber.exe PodUrl ProductInformation ScreenSnippet.exe ScreenSnippet.resources.dll ScreenSnippet.resources.dll_1 ScreenSnippet.resources.dll_2 Symphony Symphony.config Symphony.exe VkICD_mock_icd.dll VkLayer_core_validation.dll VkLayer_object_tracker.dll VkLayer_parameter_validation.dll VkLayer_threading.dll VkLayer_unique_objects.dll _ __1 am.pak appupdate.yml blink_image_resources_200_percent.pak cld.node d3dcompiler_47.dll ffmpeg.dll index.js indexvalidatorx64.exe libEGL.dll libGLESv2.dll libsymphonysearchx64.dll lz4winx64.exe node_modules npmignore osmesa.dll tarwin.exe"/>
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify FreeDiskSpace.exe Jobber.exe PodUrl ProductInformation ScreenSnippet.exe ScreenSnippet.resources.dll ScreenSnippet.resources.dll_1 ScreenSnippet.resources.dll_2 Symphony Symphony.config Symphony.exe VkICD_mock_icd.dll VkLayer_core_validation.dll VkLayer_object_tracker.dll VkLayer_parameter_validation.dll VkLayer_threading.dll VkLayer_unique_objects.dll _ __1 am.pak appupdate.yml blink_image_resources_200_percent.pak cld.node d3dcompiler_47.dll ffmpeg.dll index.js indexvalidatorx64.exe libEGL.dll libGLESv2.dll libsymphonysearchx64.dll lz4winx64.exe npmignore tarwin.exe"/>
<ATTRIBUTE name="CurrentFeature" value="MainFeature"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">
<ROW File="CODE_OF_CONDUCT.md" Component_="npmignore" FileName="CODE_O~1.MD|CODE_OF_CONDUCT.md" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\CODE_OF_CONDUCT.md" SelfReg="false" NextFile="COPYING"/>
<ROW File="COPYING" Component_="npmignore" FileName="COPYING" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\COPYING" SelfReg="false" NextFile="esdoc.json"/>
<ROW File="FreeDiskSpace.exe" Component_="FreeDiskSpace.exe" FileName="FREEDI~1.EXE|FreeDiskSpace.exe" Attributes="0" SourcePath="..\..\node_modules\electron-utils\FreeDiskSpace\bin\Release\FreeDiskSpace.exe" SelfReg="false" NextFile="v8_context_snapshot.bin" DigSign="true"/>
<ROW File="Jobber.exe" Component_="Jobber.exe" FileName="Jobber.exe" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\vendor\jobber\Jobber.exe" SelfReg="false" NextFile="cld.node" DigSign="true"/>
<ROW File="Jobber.exe" Component_="Jobber.exe" FileName="Jobber.exe" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\vendor\jobber\Jobber.exe" SelfReg="false" NextFile="indexvalidatorx64.exe" DigSign="true"/>
<ROW File="LICENSE.electron.txt" Component_="blink_image_resources_200_percent.pak" FileName="LICENS~1.TXT|LICENSE.electron.txt" Attributes="0" SourcePath="..\..\dist\win-unpacked\LICENSE.electron.txt" SelfReg="false" NextFile="LICENSES.chromium.html"/>
<ROW File="LICENSES.chromium.html" Component_="blink_image_resources_200_percent.pak" FileName="LICENS~1.HTM|LICENSES.chromium.html" Attributes="0" SourcePath="..\..\dist\win-unpacked\LICENSES.chromium.html" SelfReg="false" NextFile="natives_blob.bin"/>
<ROW File="ScreenSnippet.exe" Component_="ScreenSnippet.exe" FileName="SCREEN~1.EXE|ScreenSnippet.exe" Attributes="0" SourcePath="..\..\node_modules\screen-snippet\bin\Release\ScreenSnippet.exe" SelfReg="false" NextFile="build.cmd" DigSign="true"/>
@ -164,8 +162,8 @@
<ROW File="build.sh" Component_="npmignore" FileName="build.sh" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\build.sh" SelfReg="false" NextFile="CODE_OF_CONDUCT.md"/>
<ROW File="ca.pak" Component_="am.pak" FileName="ca.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\ca.pak" SelfReg="false" NextFile="cs.pak"/>
<ROW File="chrome_100_percent.pak" Component_="blink_image_resources_200_percent.pak" FileName="CHROME~1.PAK|chrome_100_percent.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\chrome_100_percent.pak" SelfReg="false" NextFile="chrome_200_percent.pak"/>
<ROW File="chrome_200_percent.pak" Component_="blink_image_resources_200_percent.pak" FileName="CHROME~2.PAK|chrome_200_percent.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\chrome_200_percent.pak" SelfReg="false" NextFile="osmesa.dll"/>
<ROW File="cld.node" Component_="cld.node" FileName="CLD~1.NOD|cld.node" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\@paulcbetts\cld\build\Release\cld.node" SelfReg="false" NextFile="indexvalidatorx64.exe"/>
<ROW File="chrome_200_percent.pak" Component_="blink_image_resources_200_percent.pak" FileName="CHROME~2.PAK|chrome_200_percent.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\chrome_200_percent.pak" SelfReg="false" NextFile="resources.pak"/>
<ROW File="cld.node" Component_="cld.node" FileName="CLD~1.NOD|cld.node" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\@nornagon\cld\build\Release\cld.node" SelfReg="false"/>
<ROW File="cs.pak" Component_="am.pak" FileName="cs.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\cs.pak" SelfReg="false" NextFile="da.pak"/>
<ROW File="d3dcompiler_47.dll" Component_="d3dcompiler_47.dll" FileName="D3DCOM~1.DLL|d3dcompiler_47.dll" Attributes="0" SourcePath="..\..\dist\win-unpacked\d3dcompiler_47.dll" SelfReg="false" NextFile="ffmpeg.dll"/>
<ROW File="da.pak" Component_="am.pak" FileName="da.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\da.pak" SelfReg="false" NextFile="de.pak"/>
@ -208,7 +206,6 @@
<ROW File="natives_blob.bin" Component_="blink_image_resources_200_percent.pak" FileName="NATIVE~1.BIN|natives_blob.bin" Attributes="0" SourcePath="..\..\dist\win-unpacked\natives_blob.bin" SelfReg="false" NextFile="Symphony.exe"/>
<ROW File="nb.pak" Component_="am.pak" FileName="nb.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\nb.pak" SelfReg="false" NextFile="nl.pak"/>
<ROW File="nl.pak" Component_="am.pak" FileName="nl.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\nl.pak" SelfReg="false" NextFile="pl.pak"/>
<ROW File="osmesa.dll" Component_="osmesa.dll" FileName="osmesa.dll" Attributes="0" SourcePath="..\..\dist\win-unpacked\osmesa.dll" SelfReg="false" NextFile="resources.pak"/>
<ROW File="package.json" Component_="npmignore" FileName="PACKAG~1.JSO|package.json" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\package.json" SelfReg="false" NextFile="Jobber.exe"/>
<ROW File="pl.pak" Component_="am.pak" FileName="pl.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\pl.pak" SelfReg="false" NextFile="ptBR.pak"/>
<ROW File="ptBR.pak" Component_="am.pak" FileName="pt-BR.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\pt-BR.pak" SelfReg="false" NextFile="ptPT.pak"/>
@ -226,7 +223,7 @@
<ROW File="tarwin.exe" Component_="tarwin.exe" FileName="tar-win.exe" Attributes="0" SourcePath="..\..\library\tar-win.exe" SelfReg="false" NextFile="ScreenSnippet.resources.dll" DigSign="true"/>
<ROW File="te.pak" Component_="am.pak" FileName="te.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\te.pak" SelfReg="false" NextFile="th.pak"/>
<ROW File="th.pak" Component_="am.pak" FileName="th.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\th.pak" SelfReg="false" NextFile="tr.pak"/>
<ROW File="titleBarStyles.css" Component_="Symphony.config" FileName="TITLEB~1.CSS|titleBarStyles.css" Attributes="0" SourcePath="..\..\dist\win-unpacked\config\titleBarStyles.css" SelfReg="false"/>
<ROW File="titleBarStyles.css" Component_="Symphony.config" FileName="TITLEB~1.CSS|titleBarStyles.css" Attributes="0" SourcePath="..\..\dist\win-unpacked\config\titleBarStyles.css" SelfReg="false" NextFile="cld.node"/>
<ROW File="tr.pak" Component_="am.pak" FileName="tr.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\tr.pak" SelfReg="false" NextFile="uk.pak"/>
<ROW File="uk.pak" Component_="am.pak" FileName="uk.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\uk.pak" SelfReg="false" NextFile="vi.pak"/>
<ROW File="v8_context_snapshot.bin" Component_="blink_image_resources_200_percent.pak" FileName="V8_CON~1.BIN|v8_context_snapshot.bin" Attributes="0" SourcePath="..\..\dist\win-unpacked\v8_context_snapshot.bin" SelfReg="false" NextFile="ScreenSnippet.resources.dll_2"/>
@ -585,7 +582,6 @@
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiCreateFolderComponent">
<ROW Directory_="Symphony_Dir" Component_="Symphony" ManualDelete="false"/>
<ROW Directory_="node_modules_Dir" Component_="node_modules" ManualDelete="false"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiCustActComponent">
<ROW Action="AI_AiBackupCleanup" Type="1" Source="ResourceCleaner.dll" Target="OnAiBackupCleanup" WithoutSeq="true"/>

View File

@ -75,7 +75,7 @@
<ROW Directory="TARGETDIR" DefaultDir="SourceDir"/>
<ROW Directory="app.asar.unpacked_Dir" Directory_Parent="resources_Dir" DefaultDir="APPASA~1.UNP|app.asar.unpacked"/>
<ROW Directory="build_Dir" Directory_Parent="cld_Dir" DefaultDir="build"/>
<ROW Directory="cld_Dir" Directory_Parent="paulcbetts_Dir" DefaultDir="cld"/>
<ROW Directory="cld_Dir" Directory_Parent="nornagon_Dir" DefaultDir="cld"/>
<ROW Directory="config_Dir" Directory_Parent="APPDIR" DefaultDir="config"/>
<ROW Directory="enUS_Dir" Directory_Parent="APPDIR" DefaultDir="en-US"/>
<ROW Directory="frFR_Dir" Directory_Parent="APPDIR" DefaultDir="fr-FR"/>
@ -85,7 +85,7 @@
<ROW Directory="library_Dir" Directory_Parent="APPDIR" DefaultDir="library"/>
<ROW Directory="locales_Dir" Directory_Parent="APPDIR" DefaultDir="locales"/>
<ROW Directory="node_modules_Dir" Directory_Parent="app.asar.unpacked_Dir" DefaultDir="NODE_M~1|node_modules"/>
<ROW Directory="paulcbetts_Dir" Directory_Parent="node_modules_Dir" DefaultDir="@PAULC~1|@paulcbetts"/>
<ROW Directory="nornagon_Dir" Directory_Parent="node_modules_Dir" DefaultDir="@NORNA~1|@nornagon"/>
<ROW Directory="resources_Dir" Directory_Parent="APPDIR" DefaultDir="RESOUR~1|resources"/>
<ROW Directory="spawnrx_Dir" Directory_Parent="node_modules_Dir" DefaultDir="spawn-rx"/>
<ROW Directory="vendor_Dir" Directory_Parent="spawnrx_Dir" DefaultDir="vendor"/>
@ -115,7 +115,7 @@
<ROW Component="am.pak" ComponentId="{7F9B88EC-7331-4801-A165-8E9789C8BF82}" Directory_="locales_Dir" Attributes="0" KeyPath="am.pak" Type="0"/>
<ROW Component="appupdate.yml" ComponentId="{0C70DAF7-B9A5-42E8-8EAD-986872DA450E}" Directory_="resources_Dir" Attributes="0" KeyPath="app.asar" Type="0"/>
<ROW Component="blink_image_resources_200_percent.pak" ComponentId="{19811F96-6FFC-4970-A103-9D0F5A1A402D}" Directory_="APPDIR" Attributes="0" KeyPath="LICENSES.chromium.html" Type="0"/>
<ROW Component="cld.node" ComponentId="{29DAA150-978F-4016-9F31-5547805DE82D}" Directory_="Release_Dir" Attributes="0" KeyPath="cld.node" Type="0"/>
<ROW Component="cld.node" ComponentId="{1565FCAB-7849-4FEF-B632-ABEF6F50E515}" Directory_="Release_Dir" Attributes="0" KeyPath="cld.node" Type="0"/>
<ROW Component="d3dcompiler_47.dll" ComponentId="{86265353-5735-4FB2-85EB-26947BE73061}" Directory_="APPDIR" Attributes="0" KeyPath="d3dcompiler_47.dll"/>
<ROW Component="ffmpeg.dll" ComponentId="{6ECB1C9B-C14D-4224-A048-D2C4666426DC}" Directory_="APPDIR" Attributes="0" KeyPath="ffmpeg.dll"/>
<ROW Component="index.js" ComponentId="{101B112A-2663-4FC5-9972-1FE73CECADBC}" Directory_="lib_Dir" Attributes="0" KeyPath="index.js" Type="0"/>
@ -125,12 +125,11 @@
<ROW Component="libsymphonysearchx86.dll" ComponentId="{0FE8E551-95CE-4936-8553-217ED411CAD5}" Directory_="library_Dir" Attributes="0" KeyPath="libsymphonysearchx86.dll"/>
<ROW Component="lz4winx86.exe" ComponentId="{C71364D8-6FE2-4BA1-8D89-12B075FFAEFD}" Directory_="library_Dir" Attributes="0" KeyPath="lz4winx86.exe"/>
<ROW Component="npmignore" ComponentId="{77C01E13-062C-4D92-AE13-0A52C3120BA8}" Directory_="spawnrx_Dir" Attributes="0" KeyPath="COPYING" Type="0"/>
<ROW Component="osmesa.dll" ComponentId="{8BDDF717-1B70-4A48-96ED-9D5A52DC2072}" Directory_="APPDIR" Attributes="0" KeyPath="osmesa.dll"/>
<ROW Component="tarwin.exe" ComponentId="{B7E57E12-8788-49D4-A31C-23E821D36B2F}" Directory_="library_Dir" Attributes="0" KeyPath="tarwin.exe"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">
<ROW Feature="D564007E3BBE4F85950A09B470A7CA65" Title="Visual C++ Redistributable for Visual Studio 2013 x86" Description="Visual C++ Redistributable for Visual Studio 2013 x86" Display="3" Level="1" Attributes="0"/>
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify FreeDiskSpace.exe Jobber.exe PodUrl ProductInformation ScreenSnippet.exe ScreenSnippet.resources.dll ScreenSnippet.resources.dll_1 ScreenSnippet.resources.dll_2 Symphony Symphony.config Symphony.exe VkICD_mock_icd.dll VkLayer_core_validation.dll VkLayer_object_tracker.dll VkLayer_parameter_validation.dll VkLayer_threading.dll VkLayer_unique_objects.dll _ __1 am.pak appupdate.yml blink_image_resources_200_percent.pak cld.node d3dcompiler_47.dll ffmpeg.dll index.js indexvalidatorx86.exe libEGL.dll libGLESv2.dll libsymphonysearchx86.dll lz4winx86.exe npmignore osmesa.dll tarwin.exe"/>
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify FreeDiskSpace.exe Jobber.exe PodUrl ProductInformation ScreenSnippet.exe ScreenSnippet.resources.dll ScreenSnippet.resources.dll_1 ScreenSnippet.resources.dll_2 Symphony Symphony.config Symphony.exe VkICD_mock_icd.dll VkLayer_core_validation.dll VkLayer_object_tracker.dll VkLayer_parameter_validation.dll VkLayer_threading.dll VkLayer_unique_objects.dll _ __1 am.pak appupdate.yml blink_image_resources_200_percent.pak cld.node d3dcompiler_47.dll ffmpeg.dll index.js indexvalidatorx86.exe libEGL.dll libGLESv2.dll libsymphonysearchx86.dll lz4winx86.exe npmignore tarwin.exe"/>
<ATTRIBUTE name="CurrentFeature" value="MainFeature"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">
@ -154,7 +153,7 @@
<ROW File="VkLayer_threading.dll" Component_="VkLayer_threading.dll" FileName="VKLAYE~4.DLL|VkLayer_threading.dll" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\VkLayer_threading.dll" SelfReg="false" NextFile="VkLayer_unique_objects.dll"/>
<ROW File="VkLayer_unique_objects.dll" Component_="VkLayer_unique_objects.dll" FileName="VKLAYE~5.DLL|VkLayer_unique_objects.dll" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\VkLayer_unique_objects.dll" SelfReg="false" NextFile="titleBarStyles.css"/>
<ROW File="am.pak" Component_="am.pak" FileName="am.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\am.pak" SelfReg="false" NextFile="ar.pak"/>
<ROW File="app.asar" Component_="appupdate.yml" FileName="APP~1.ASA|app.asar" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar" SelfReg="false" NextFile="cld.node"/>
<ROW File="app.asar" Component_="appupdate.yml" FileName="APP~1.ASA|app.asar" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar" SelfReg="false" NextFile="build.cmd"/>
<ROW File="ar.pak" Component_="am.pak" FileName="ar.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\ar.pak" SelfReg="false" NextFile="bg.pak"/>
<ROW File="bg.pak" Component_="am.pak" FileName="bg.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\bg.pak" SelfReg="false" NextFile="bn.pak"/>
<ROW File="bn.pak" Component_="am.pak" FileName="bn.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\bn.pak" SelfReg="false" NextFile="ca.pak"/>
@ -162,8 +161,8 @@
<ROW File="build.sh" Component_="npmignore" FileName="build.sh" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\build.sh" SelfReg="false" NextFile="CODE_OF_CONDUCT.md"/>
<ROW File="ca.pak" Component_="am.pak" FileName="ca.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\ca.pak" SelfReg="false" NextFile="cs.pak"/>
<ROW File="chrome_100_percent.pak" Component_="blink_image_resources_200_percent.pak" FileName="CHROME~1.PAK|chrome_100_percent.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\chrome_100_percent.pak" SelfReg="false" NextFile="chrome_200_percent.pak"/>
<ROW File="chrome_200_percent.pak" Component_="blink_image_resources_200_percent.pak" FileName="CHROME~2.PAK|chrome_200_percent.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\chrome_200_percent.pak" SelfReg="false" NextFile="osmesa.dll"/>
<ROW File="cld.node" Component_="cld.node" FileName="CLD~1.NOD|cld.node" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar.unpacked\node_modules\@paulcbetts\cld\build\Release\cld.node" SelfReg="false" NextFile="build.cmd"/>
<ROW File="chrome_200_percent.pak" Component_="blink_image_resources_200_percent.pak" FileName="CHROME~2.PAK|chrome_200_percent.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\chrome_200_percent.pak" SelfReg="false" NextFile="resources.pak"/>
<ROW File="cld.node" Component_="cld.node" FileName="CLD~1.NOD|cld.node" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar.unpacked\node_modules\@nornagon\cld\build\Release\cld.node" SelfReg="false"/>
<ROW File="cs.pak" Component_="am.pak" FileName="cs.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\cs.pak" SelfReg="false" NextFile="da.pak"/>
<ROW File="d3dcompiler_47.dll" Component_="d3dcompiler_47.dll" FileName="D3DCOM~1.DLL|d3dcompiler_47.dll" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\d3dcompiler_47.dll" SelfReg="false" NextFile="ffmpeg.dll"/>
<ROW File="da.pak" Component_="am.pak" FileName="da.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\da.pak" SelfReg="false" NextFile="de.pak"/>
@ -206,7 +205,6 @@
<ROW File="natives_blob.bin" Component_="blink_image_resources_200_percent.pak" FileName="NATIVE~1.BIN|natives_blob.bin" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\natives_blob.bin" SelfReg="false" NextFile="Symphony.config"/>
<ROW File="nb.pak" Component_="am.pak" FileName="nb.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\nb.pak" SelfReg="false" NextFile="nl.pak"/>
<ROW File="nl.pak" Component_="am.pak" FileName="nl.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\nl.pak" SelfReg="false" NextFile="pl.pak"/>
<ROW File="osmesa.dll" Component_="osmesa.dll" FileName="osmesa.dll" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\osmesa.dll" SelfReg="false" NextFile="resources.pak"/>
<ROW File="package.json" Component_="npmignore" FileName="PACKAG~1.JSO|package.json" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\package.json" SelfReg="false" NextFile="Jobber.exe"/>
<ROW File="pl.pak" Component_="am.pak" FileName="pl.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\pl.pak" SelfReg="false" NextFile="ptBR.pak"/>
<ROW File="ptBR.pak" Component_="am.pak" FileName="pt-BR.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\pt-BR.pak" SelfReg="false" NextFile="ptPT.pak"/>
@ -224,7 +222,7 @@
<ROW File="tarwin.exe" Component_="tarwin.exe" FileName="tar-win.exe" Attributes="0" SourcePath="..\..\library\tar-win.exe" SelfReg="false" NextFile="ScreenSnippet.exe" DigSign="true"/>
<ROW File="te.pak" Component_="am.pak" FileName="te.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\te.pak" SelfReg="false" NextFile="th.pak"/>
<ROW File="th.pak" Component_="am.pak" FileName="th.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\th.pak" SelfReg="false" NextFile="tr.pak"/>
<ROW File="titleBarStyles.css" Component_="Symphony.config" FileName="TITLEB~1.CSS|titleBarStyles.css" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\config\titleBarStyles.css" SelfReg="false"/>
<ROW File="titleBarStyles.css" Component_="Symphony.config" FileName="TITLEB~1.CSS|titleBarStyles.css" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\config\titleBarStyles.css" SelfReg="false" NextFile="cld.node"/>
<ROW File="tr.pak" Component_="am.pak" FileName="tr.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\tr.pak" SelfReg="false" NextFile="uk.pak"/>
<ROW File="uk.pak" Component_="am.pak" FileName="uk.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\uk.pak" SelfReg="false" NextFile="vi.pak"/>
<ROW File="v8_context_snapshot.bin" Component_="blink_image_resources_200_percent.pak" FileName="V8_CON~1.BIN|v8_context_snapshot.bin" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\v8_context_snapshot.bin" SelfReg="false" NextFile="ScreenSnippet.resources.dll_2"/>

View File

@ -26,15 +26,15 @@
},
"build": {
"asarUnpack": [
"node_modules/@paulcbetts/cld/build/Release/cld.node"
"node_modules/@nornagon/cld/build/Release/cld.node"
],
"files": [
"!coverage/*",
"!installer/*",
"!tests/*",
"!node_modules/@paulcbetts/cld/deps/cld${/*}",
"!node_modules/@paulcbetts/cld/build/deps${/*}",
"!node_modules/@paulcbetts/spellchecker/vendor${/*}"
"!node_modules/@nornagon/cld/deps/cld${/*}",
"!node_modules/@nornagon/cld/build/deps${/*}",
"!node_modules/@nornagon/spellchecker/vendor${/*}"
],
"extraFiles": [
"config/Symphony.config",
@ -157,6 +157,6 @@
},
"optionalDependencies": {
"screen-snippet": "git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.5",
"swift-search": "3.0.2"
"swift-search": "5.0.0-beta.1"
}
}

View File

@ -1,4 +1,5 @@
import { handleChildWindow } from '../src/app/child-window-handler';
import { config } from '../src/app/config-handler';
import { windowHandler } from '../src/app/window-handler';
import { injectStyles } from '../src/app/window-utils';
import { ipcRenderer } from './__mocks__/electron';
@ -68,17 +69,29 @@ describe('child window handle', () => {
});
it('should call `did-finish-load` correctly on WindowOS', () => {
config.getGlobalConfigFields = jest.fn(() => {
return {
url: 'https://foundation-dev.symphony.com',
};
});
const newWinUrl = 'about:blank';
const args = [newWinUrl, frameName, disposition, newWinOptions];
const spy = jest.spyOn(newWinOptions.webContents.webContents, 'send');
handleChildWindow(ipcRenderer as any);
ipcRenderer.send('new-window', ...args);
ipcRenderer.send('did-finish-load');
expect(spy).lastCalledWith('page-load', { isWindowsOS: true});
expect(spy).lastCalledWith('page-load', {
enableCustomTitleBar: false,
isMainWindow: false,
isWindowsOS: true,
locale: 'en-US',
origin: 'https://foundation-dev.symphony.com',
resources: {},
});
expect(injectStyles).toBeCalled();
});
it('should call `windowHandler.openUrlInDefaultBrowser` when url in invalid', () => {
it('should call `windowHandler.openUrlInDefaultBrowser` when url in invalid', () => {
const newWinUrl = 'invalid';
const args = [newWinUrl, frameName, disposition, newWinOptions];
const spy = jest.spyOn(windowHandler, 'openUrlInDefaultBrowser');

View File

@ -3,7 +3,9 @@ import { BrowserWindow, WebContents } from 'electron';
import { parse as parseQuerystring } from 'querystring';
import { format, parse, Url } from 'url';
import { isDevEnv, isWindowsOS } from '../common/env';
import { i18n } from '../common/i18n';
import { getGuid } from '../common/utils';
import { config } from './config-handler';
import { monitorWindowActions, removeWindowEventListener } from './window-actions';
import { ICustomBrowserWindow, windowHandler } from './window-handler';
import {
@ -58,9 +60,24 @@ export const handleChildWindow = (webContents: WebContents): void => {
const emptyUrlString = 'about:blank';
const dispositionWhitelist = ['new-window', 'foreground-tab'];
const fullMainUrl = `${mainWinParsedUrl.protocol}//${mainWinParsedUrl.host}/`;
// If the main url and new window url are the same,
// we open that in a browser rather than a separate window
if (newWinUrl === fullMainUrl) {
event.preventDefault();
windowHandler.openUrlInDefaultBrowser(newWinUrl);
return;
}
// only allow window.open to succeed is if coming from same hsot,
// otherwise open in default browser.
if ((newWinHost === mainWinHost || newWinUrl === emptyUrlString) && dispositionWhitelist.includes(disposition)) {
if ((newWinHost === mainWinHost
|| newWinUrl === emptyUrlString
|| (newWinHost
&& mainWinHost
&& newWinHost.indexOf(mainWinHost) !== -1
&& frameName !== ''))
&& dispositionWhitelist.includes(disposition)) {
const newWinKey = getGuid();
if (!frameName) {
@ -117,7 +134,15 @@ export const handleChildWindow = (webContents: WebContents): void => {
return;
}
windowHandler.addWindow(newWinKey, browserWin);
browserWin.webContents.send('page-load', { isWindowsOS });
const { url } = config.getGlobalConfigFields([ 'url' ]);
browserWin.webContents.send('page-load', {
isWindowsOS,
locale: i18n.getLocale(),
resources: i18n.loadedResources,
origin: url,
enableCustomTitleBar: false,
isMainWindow: false,
});
// Inserts css on to the window
await injectStyles(browserWin, false);
browserWin.winName = frameName;
@ -133,11 +158,19 @@ export const handleChildWindow = (webContents: WebContents): void => {
removeWindowEventListener(browserWin);
});
// Certificate verification proxy
if (!isDevEnv) {
browserWin.webContents.session.setCertificateVerifyProc(handleCertificateProxyVerification);
if (browserWin.webContents) {
// validate link and create a child window or open in browser
handleChildWindow(browserWin.webContents);
// Certificate verification proxy
if (!isDevEnv) {
browserWin.webContents.session.setCertificateVerifyProc(handleCertificateProxyVerification);
}
// Updates media permissions for preload context
const { permissions } = config.getGlobalConfigFields([ 'permissions' ]);
browserWin.webContents.send('is-screen-share-enabled', permissions.media);
}
// TODO: handle Permission Requests
});
} else {
event.preventDefault();

View File

@ -5,9 +5,9 @@ import { isMac, isWindowsOS } from '../common/env';
import { throttle } from '../common/utils';
import { config } from './config-handler';
import { ICustomBrowserWindow, windowHandler } from './window-handler';
import { showPopupMenu } from './window-utils';
import { showPopupMenu, windowExists } from './window-utils';
export const saveWindowSettings = (): void => {
const saveWindowSettings = (): void => {
const browserWindow = BrowserWindow.getFocusedWindow() as ICustomBrowserWindow;
if (browserWindow && !browserWindow.isDestroyed()) {
@ -15,32 +15,38 @@ export const saveWindowSettings = (): void => {
const [ width, height ] = browserWindow.getSize();
if (x && y && width && height) {
browserWindow.webContents.send('boundsChange', { x, y, width, height, windowName: browserWindow.winName } as IBoundsChange);
if (browserWindow.winName === apiName.mainWindowName) {
const isMaximized = browserWindow.isMaximized();
const isFullScreen = browserWindow.isFullScreen();
config.updateUserConfig({ mainWinPos: { x, y, width, height, isMaximized, isFullScreen } });
}
}
}
};
export const enterFullScreen = () => {
const windowMaximized = async (): Promise<void> => {
const browserWindow = BrowserWindow.getFocusedWindow() as ICustomBrowserWindow;
if (browserWindow && !browserWindow.isDestroyed() && browserWindow.winName === apiName.mainWindowName) {
browserWindow.webContents.send('window-enter-full-screen');
if (browserWindow && windowExists(browserWindow) && browserWindow.winName === apiName.mainWindowName) {
const isMaximized = browserWindow.isMaximized();
const isFullScreen = browserWindow.isFullScreen();
if (isFullScreen) {
browserWindow.webContents.send('window-enter-full-screen');
}
const { mainWinPos } = config.getUserConfigFields([ 'mainWinPos' ]);
await config.updateUserConfig( { mainWinPos: { ...mainWinPos, ...{ isMaximized, isFullScreen } } });
}
};
export const leaveFullScreen = () => {
const windowUnmaximized = async (): Promise<void> => {
const browserWindow = BrowserWindow.getFocusedWindow() as ICustomBrowserWindow;
if (browserWindow && !browserWindow.isDestroyed() && browserWindow.winName === apiName.mainWindowName) {
browserWindow.webContents.send('window-leave-full-screen');
if (browserWindow && windowExists(browserWindow) && browserWindow.winName === apiName.mainWindowName) {
const isMaximized = browserWindow.isMaximized();
const isFullScreen = browserWindow.isFullScreen();
if (!isFullScreen) {
browserWindow.webContents.send('window-leave-full-screen');
}
const { mainWinPos } = config.getUserConfigFields([ 'mainWinPos' ]);
await config.updateUserConfig( { mainWinPos: { ...mainWinPos, ...{ isMaximized, isFullScreen } } });
}
};
export const throttledWindowChanges = throttle(saveWindowSettings, 1000);
const throttledWindowChanges = throttle(saveWindowSettings, 1000);
/**
* Tries finding a window we have created with given name. If found, then
@ -140,15 +146,18 @@ export const monitorWindowActions = (window: BrowserWindow): void => {
if (!window || window.isDestroyed()) {
return;
}
const eventNames = [ 'move', 'resize', 'maximize', 'unmaximize' ];
const eventNames = [ 'move', 'resize' ];
eventNames.forEach((event: string) => {
if (window) {
// @ts-ignore
window.on(event, throttledWindowChanges);
}
});
window.on('enter-full-screen', enterFullScreen);
window.on('leave-full-screen', leaveFullScreen);
window.on('enter-full-screen', windowMaximized);
window.on('maximize', windowMaximized);
window.on('leave-full-screen', windowUnmaximized);
window.on('unmaximize', windowUnmaximized);
};
/**
@ -160,13 +169,16 @@ export const removeWindowEventListener = (window: BrowserWindow): void => {
if (!window || window.isDestroyed()) {
return;
}
const eventNames = [ 'move', 'resize', 'maximize', 'unmaximize' ];
const eventNames = [ 'move', 'resize' ];
eventNames.forEach((event: string) => {
if (window) {
// @ts-ignore
window.removeListener(event, throttledWindowChanges);
}
});
window.removeListener('enter-full-screen', enterFullScreen);
window.removeListener('leave-full-screen', leaveFullScreen);
window.removeListener('enter-full-screen', windowMaximized);
window.removeListener('maximize', windowMaximized);
window.removeListener('leave-full-screen', windowUnmaximized);
window.removeListener('unmaximize', windowUnmaximized);
};

View File

@ -229,6 +229,13 @@ export class WindowHandler {
...this.windowOpts, ...getBounds(this.config.mainWinPos, DEFAULT_WIDTH, DEFAULT_HEIGHT),
}) as ICustomBrowserWindow;
this.mainWindow.winName = apiName.mainWindowName;
const { isFullScreen, isMaximized } = this.config.mainWinPos;
if (isMaximized) {
this.mainWindow.maximize();
}
if (isFullScreen) {
this.mainWindow.setFullScreen(true);
}
// Event needed to hide native menu bar on Windows 10 as we use custom menu bar
this.mainWindow.webContents.once('did-start-loading', () => {
@ -260,6 +267,7 @@ export class WindowHandler {
resources: i18n.loadedResources,
origin: this.globalConfig.url,
enableCustomTitleBar: this.isCustomTitleBar,
isMainWindow: true,
});
this.appMenu = new AppMenu();
const { permissions } = config.getGlobalConfigFields([ 'permissions' ]);

View File

@ -42,7 +42,7 @@ const createAPI = () => {
createAPI();
// When the window is completely loaded
ipcRenderer.on('page-load', (_event, { locale, resources, origin, enableCustomTitleBar }) => {
ipcRenderer.on('page-load', (_event, { locale, resources, origin, enableCustomTitleBar, isMainWindow }) => {
// origin for postMessage targetOrigin communication
if (origin) {
appBridge.origin = origin;
@ -83,7 +83,9 @@ ipcRenderer.on('page-load', (_event, { locale, resources, origin, enableCustomTi
ReactDOM.render(downloadManager, footerSFE);
}
ipcRenderer.send(apiName.symphonyApi, {
cmd: apiCmds.initMainWindow,
});
if (isMainWindow) {
ipcRenderer.send(apiName.symphonyApi, {
cmd: apiCmds.initMainWindow,
});
}
});