Skip to content
52 changes: 46 additions & 6 deletions .github/workflows/stageBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,63 @@ jobs:
- name: Setup depot_tools
run: |
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git /tmp/depot_tools

- name: add depot_tools path to PATH
run: |
echo "${{ github.workspace }}/depot_tools" >> $GITHUB_PATH
echo "/tmp/depot_tools" >> $GITHUB_PATH

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Create gclient config
run: |
cat > .gclient << 'EOF'
solutions = [
{
"managed": False,
"name": "devtools-frontend",
"url": "https://chromium.googlesource.com/devtools/devtools-frontend.git",
"custom_deps": {},
"deps_file": "DEPS",
"safesync_url": "",
},
]
EOF

- name: Sync dependencies
run: |
export PATH="${{ github.workspace }}/depot_tools:$PATH"
export PATH="/tmp/depot_tools:$PATH"
gclient sync
# Add ninja to PATH (check both possible locations)
if [ -d "devtools-frontend/third_party/ninja" ]; then
export PATH="$PWD/devtools-frontend/third_party/ninja:$PATH"
echo "$PWD/devtools-frontend/third_party/ninja" >> $GITHUB_PATH
elif [ -d "third_party/ninja" ]; then
export PATH="$PWD/third_party/ninja:$PATH"
echo "$PWD/third_party/ninja" >> $GITHUB_PATH
fi

- name: Generate build files
run: |
export PATH="/tmp/depot_tools:$PATH"
# Ensure ninja is in PATH
if [ -d "devtools-frontend/third_party/ninja" ]; then
export PATH="$PWD/devtools-frontend/third_party/ninja:$PATH"
elif [ -d "third_party/ninja" ]; then
export PATH="$PWD/third_party/ninja:$PATH"
fi
cd devtools-frontend || cd .
gn gen out/Default

- name: Build Chrome DevTools
run: |
export PATH="/tmp/depot_tools:$PATH"
# Ensure ninja is in PATH
if [ -d "devtools-frontend/third_party/ninja" ]; then
export PATH="$PWD/devtools-frontend/third_party/ninja:$PATH"
elif [ -d "third_party/ninja" ]; then
export PATH="$PWD/third_party/ninja:$PATH"
fi
cd devtools-frontend || cd .
npm install
npm run build

Expand Down Expand Up @@ -75,4 +115,4 @@ jobs:
--acl public-read --follow-symlinks --delete

- name: Confirm S3 upload
run: aws s3 ls s3://${{ env.S3_BUCKET }}/${{ inputs.version }}/
run: aws s3 ls s3://${{ env.S3_BUCKET }}/${{ inputs.version }}/
18 changes: 18 additions & 0 deletions front_end/core/sdk/OverlayModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,28 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
Promise<void> {
await this.domModel.requestDocument();
this.inspectModeEnabledInternal = mode !== Protocol.Overlay.InspectMode.None;
this.notifyParentWindowOfInspectModeChange();
this.dispatchEventToListeners(Events.InspectModeWillBeToggled, this);
this.highlighter.setInspectMode(mode, this.buildHighlightConfig('all', showDetailedTooltip));
}

private notifyParentWindowOfInspectModeChange(): void {
// If the window is not undefined and the parent is not the same as the window, send a message to the parent window.
try {
if (typeof window !== "undefined" && window.parent && window.parent !== window) {
window.parent.postMessage(
{
type: "inspectModeStateChanged",
enabled: this.inspectModeEnabledInternal,
},
"*"
);
}
} catch (error) {
console.error('Error sending inspect mode', error);
}
}

inspectModeEnabled(): boolean {
return this.inspectModeEnabledInternal;
}
Expand Down