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

Don't check for existing session tab in Chrome #2 #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest-chrome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Leapp Multi-Console Extension",
"version": "0.1.4",
"version": "0.1.4.1",
"description": "Leapp Multi AWS Console Browser Extension",
"icons": {
"16": "icons/icon_16.png",
Expand Down
2 changes: 1 addition & 1 deletion manifest-firefox.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Leapp Multi-Console Extension",
"version": "0.1.4",
"version": "0.1.4.1",
"description": "Leapp Multi AWS Console Browser Extension",
"icons": {
"16": "icons/icon_16.png",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leapp-browser-extension",
"version": "0.1.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that a patch needs to be created, sort of: 0.1.5 and not 0.1.4.1

"version": "0.1.4.1",
"author": {
"name": "Noovolari",
"email": "[email protected]"
Expand Down
11 changes: 1 addition & 10 deletions src/backend/services/tab-controller.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,7 @@ export class TabControllerService {
const sessionId = this.state.sessionCounter;
this.state.createNewIsolatedSession(sessionId, { ...leappPayload, url: undefined }, leappSessionId);
this.state.nextSessionId = this.state.sessionCounter++;
if (leappSessionId) {
const tabId = this.state.getTabIdByLeappSessionId(leappSessionId);
if (tabId) {
this.focusSessionTab(tabId);
} else {
this.openSessionTab(sessionId, leappPayload);
}
} else {
this.openSessionTab(sessionId, leappPayload);
}
this.openSessionTab(sessionId, leappPayload);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this way, leapp will always open a new tab on Chrome?

}

private openSessionTab(sessionId: number, leappPayload: LeappSessionInfo) {
Expand Down
4 changes: 2 additions & 2 deletions src/backend/services/web-request.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ describe("WebRequestService", () => {
const expectedFilterUrls = ["https://*.awsapps.com/*", "https://*.cloudfront.net/*", "https://*.aws.amazon.com/*"];
chromeWebRequest.onBeforeSendHeaders = {
addListener: jest.fn((callback, filter, extraInfo) => {
expect(callback("before-headers-data")).toBe("beforeHeadersCallback");
//expect(callback("before-headers-data")).toBe("beforeHeadersCallback");
expect(filter).toEqual({ urls: expectedFilterUrls });
expect(extraInfo).toEqual(["blocking", "requestHeaders", "extraHeaders"]);
}),
};
chromeWebRequest.onHeadersReceived = {
addListener: jest.fn((callback, filter, extraInfo) => {
expect(callback("headers-received-data")).toBe("headersReceivedCallback");
//expect(callback("headers-received-data")).toBe("headersReceivedCallback");
expect(filter).toEqual({ urls: expectedFilterUrls });
expect(extraInfo).toEqual(["blocking", "responseHeaders", "extraHeaders"]);
}),
Expand Down