question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Simplify calling the focused window

See original GitHub issue

Issuehunt badges

Having to do this every time is slightly inconvenient:

const win = electron.BrowserWindow.getFocusedWindow();

(async () => {
	const emoji = await ipc.callRenderer(win, 'get-emoji', 'unicorn');
	console.log(emoji);
	//=> '🦄'
})();

I’m thinking something like:

(async () => {
	const emoji = await ipc.callFocusedRenderer('get-emoji', 'unicorn');
	console.log(emoji);
	//=> '🦄'
})();

Thoughts?


IssueHunt Summary

ulken ulken has been rewarded.

Backers (Total: $40.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
issuehunt-app[bot]commented, Nov 9, 2019

@sindresorhus has rewarded $36.00 to @ulken. See it on IssueHunt

  • 💰 Total deposit: $40.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $4.00
0reactions
ulkencommented, Nov 8, 2019

I went ahead and did it anyhow. Hope it will bring you any value 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make it easier to focus on tasks - Microsoft Support
Windows offers lots of ways to minimize distractions so it's easier to focus on tasks. You can declutter your taskbar and simplify the...
Read more >
Get Focused Window in WPF to front - Stack Overflow
Hi Steven I have used the Show() method to open the Dialog Window but it dosent make any difference. The only thing is...
Read more >
How to Prevent Programs From Stealing Focus in Windows
Follow these steps to stop programs from popping up in front of other ones, called "stealing focus." This should never happen.
Read more >
Window focus() Method - W3Schools
The focus() method makes a request to bring a window to the front. It may not work as you expect, due to different...
Read more >
Window pops up in background, how to make active? #1077
Under certain circumstances, when I create a window, it gets created in the background and doesn't have focus.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found