Skip to content

Commit 8f6c58b

Browse files
committed
finished window spawning changes
1 parent 5b63837 commit 8f6c58b

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

src/extension/background.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -503,24 +503,27 @@ chrome.runtime.onInstalled.addListener(() => {
503503
// chrome.windows.getCurrent allows us to still get the window from within a service worker. It returns a promise (asynchronous), so all resulting functionality must happen in the callback function,
504504
// or it will run before 'invokedScreen' variables have been captured.
505505
chrome.contextMenus.onClicked.addListener(({ menuItemId }) => {
506-
console.log('background ext screenX', chrome.windows.getCurrent());
506+
// console.log('background ext screenX', chrome.windows.getCurrent());
507507

508+
// // this was a test to see if I could dynamically set the left property to be the 0 origin of the invoked DISPLAY (as opposed to invoked window).
509+
// // this would allow you to split your screen, keep the browser open on the right side, and reactime always opens at the top left corner.
510+
// // currently, invokedScreenLeft is the left of the invoked window. To get around the issue of reactime covering the refresh button (currently needed for debugging as of 12.19.23), added a vertical offset, topOffset.
511+
// // this just pushes the top down by a fixed amount that is enough to surpass most people's bookmarks bar.
508512
chrome.system.display.getInfo((displayUnitInfo) => {
509513
console.log(displayUnitInfo);
510514
});
511515

512-
let invokedScreenTop = 0;
513-
let invokedScreenLeft = 0;
514516
chrome.windows.getCurrent((window) => {
515-
invokedScreenTop = window.top + 300 || 0;
516-
console.log('invokedTop', invokedScreenTop);
517-
invokedScreenLeft = window.left || 0;
517+
// const topOffset = 0; // use to push top down to approximately the start of the viewport (for easy access to refresh button)
518+
const invokedScreenHeight = window.height || 1000;
519+
const invokedScreenTop = window.top || 0;
520+
const invokedScreenLeft = -400;
518521
const options = {
519522
type: 'panel',
520523
left: invokedScreenLeft,
521-
top: invokedScreenTop,
524+
top: invokedScreenTop, // + topOffset,
522525
width: 1000,
523-
height: 1000,
526+
height: invokedScreenHeight, // - topOffset,
524527
url: chrome.runtime.getURL('panel.html'),
525528
};
526529
if (menuItemId === 'reactime') chrome.windows.create(options);

src/extension/build/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Reactime",
3-
"version": "22.0.0",
3+
"version": "23.0.0",
44
"devtools_page": "devtools.html",
55
"description": "A Chrome extension that helps debug React applications by memorizing the state of components with every render.",
66
"manifest_version": 3,

typedoc.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"mode": "modules",
3-
"out": "docs",
4-
"includes": ["./src/backend"],
5-
"exclude": ["**/__tests__/**", "**/**/**/build/**", "**/types/**"],
3+
4+
"entryPoints": ["src/"],
5+
"out": "docs/ src/app src/backend",
6+
"readme": "README.md",
7+
"exclude": ["**/*.spec.ts"],
8+
69
"name": "Reactime 23.0"
710
}

0 commit comments

Comments
 (0)