Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two tabs opening when creating screenshot #1

Open
timii opened this issue Jul 1, 2022 · 3 comments
Open

Two tabs opening when creating screenshot #1

timii opened this issue Jul 1, 2022 · 3 comments
Assignees
Labels
bug Something isn't working custom-area Issue about the custom area functionality full-page Issue about the full site functionality

Comments

@timii
Copy link
Owner

timii commented Jul 1, 2022

After creating either a full page or custom area screenshot, two tabs open for showing the screenshot instead of just one.

@timii timii added the bug Something isn't working label Jul 1, 2022
@timii timii self-assigned this Jul 1, 2022
@timii timii added the custom-area Issue about the custom area functionality label Jul 1, 2022
@timii
Copy link
Owner Author

timii commented Jul 1, 2022

Found a workaround: delete one of the two created tabs after the tab has been created. It's a pretty bad solution, but it works for now and also adds the feature to delete the old tab when creating a screenshot in the same tab

Source code of current solution:

chrome.tabs.query({ currentWindow: true, url: "url_of_newly_created_tab" }, function (tabs) {
            for (var i = 0; i < tabs.length; i++) {
                if (tabs[i].id !== createdTab.id && tabs[i].index > currentTabIndex + 1) {
                    chrome.tabs.remove(tabs[i].id)
                }
            }
        });

@timii
Copy link
Owner Author

timii commented Jul 11, 2022

Maybe got something to do with this

@timii
Copy link
Owner Author

timii commented Jul 28, 2022

It only happens when creating a custom area or full page screenshot. The call to send the image to the new tab is fired twice, as seen in the following screenshot:
image

@timii timii changed the title Two tabs opening when creating custom area screenshot Two tabs opening when creating screenshot Aug 17, 2022
@timii timii added the full-page Issue about the full site functionality label Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working custom-area Issue about the custom area functionality full-page Issue about the full site functionality
Projects
None yet
Development

No branches or pull requests

1 participant