-
Notifications
You must be signed in to change notification settings - Fork 144
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
fix: youtube & iframe util from packages/ui to main source #1884
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
23ad974
fix: youtube & iframe util from packages/ui to main source
smalluban 7eafd79
Add debug mode
smalluban a4c47b5
Update extension-manifest-v3/src/background/notifications.js
smalluban 76718bd
Merge remote-tracking branch 'origin/main' into fix-youtube-and-ifram…
smalluban d3683fc
Move opera notification to serp.js
smalluban 5663d02
Fix download engines command
smalluban 37908b4
Merge branch 'main' into fix-youtube-and-iframe-util
smalluban File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* Ghostery Browser Extension | ||
* https://www.ghostery.com/ | ||
* | ||
* Copyright 2017-present Ghostery GmbH. All rights reserved. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0 | ||
*/ | ||
|
||
import * as notifications from '/utils/notifications.js'; | ||
|
||
export function openNotification(tabId, id, params) { | ||
const url = chrome.runtime.getURL( | ||
`/pages/notifications/${id}.html` + | ||
(params | ||
? `?${Object.entries(params) | ||
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`) | ||
.join('&')}` | ||
: ''), | ||
); | ||
|
||
chrome.tabs.sendMessage(tabId, { | ||
action: notifications.MOUNT_ACTION, | ||
url, | ||
}); | ||
} | ||
|
||
export function closeNotification(tabId) { | ||
chrome.tabs.sendMessage(tabId, { | ||
action: notifications.UNMOUNT_ACTION, | ||
}); | ||
} | ||
|
||
chrome.runtime.onMessage.addListener((msg, sender) => { | ||
const tabId = sender.tab?.id; | ||
if (!tabId) return; | ||
|
||
switch (msg.action) { | ||
case notifications.OPEN_ACTION: { | ||
openNotification(tabId, msg.id, msg.params); | ||
break; | ||
} | ||
case notifications.CLOSE_ACTION: { | ||
closeNotification(tabId); | ||
break; | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was wondering why you "invent" the stating mode, but from the other changes it looks like it was implicitly there for some subsystems.
We have to decide how those modes should work.
Historically:
It looks like we have 3 separate aspects to deal with:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The staging mode usually does not work. They it yourself. The engines are not updated there (I suppose we have to trigger it manually).
Firstly, there was only a debug mode, but with that issue I had to add separate flag for loading engines from staging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, so you mean even if we downloaded staging engine pre-build, they would update to production engine in the runtime anyways?
I'm fine to keep the staging mode. Shall we then update all endpoints configuration to use stagingMode instead of debugMode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm start -- --staging
fails... as the staging CDN does not have the proper version of the engines..For me
--staging
should only set the engines' endpoints - as this must be used only when we know that we pushed something to the staging CDN for engines and only engines.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem occurs as we don't create staging engines on every adblocker release - perhaps we should. When this happen please reach out so we can schedule a CI build.