Skip to content

Commit

Permalink
Optimize identifier check for MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
cadivus committed Oct 23, 2024
1 parent ef7cbd0 commit 80b18bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions common/webview_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,13 @@ void WebviewHandler::sendJavaScriptChannelCallBack(const bool error, const std::

CefRefPtr<CefFrame> frame = bit->second.browser->GetMainFrame();

// GetIdentifier().ToString() does not work on MacOS
if (std::stoll(stringpatch::to_string(frame->GetIdentifier())) == frameIdInt)
// Return types for frame->GetIdentifier() differ between platforms
#if __APPLE__
bool identifierMatch = frame->GetIdentifier() == frameIdInt;
#else
bool identifierMatch = std::stoll(stringpatch::to_string(frame->GetIdentifier())) == frameIdInt;
#endif
if (identifierMatch)
{
frame->SendProcessMessage(PID_RENDERER, message);
}
Expand Down

0 comments on commit 80b18bf

Please sign in to comment.