The current URL is copied incorrectly when opening Firefox in another application and clicking on other links
Categories
(Firefox for Android :: General, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: roman.deev06, Assigned: jackyzy823)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Steps to reproduce:
- Set Firefox as your default browser.
- Open any link (e.g. https://example.com) in another application (e.g. Telegram).
- Firefox embedded in Telegram should open
- Navigate to any link on the page.
- Open the menu and click Copy link
Actual results:
The first link you opened in another application(Telegram) is copied.
Expected results:
Must copy the current URL
Assignee | ||
Comment 1•2 years ago
•
|
||
The reason is that tab
parameter is the reference of store.tab from the start
function (and never point to the newest reference)
https://github.com/mozilla-mobile/firefox-android/blob/66544029a906ceb696ede2e58f176c7afa46e5e0/android-components/components/feature/customtabs/src/main/java/mozilla/components/feature/customtabs/CustomTabsToolbarFeature.kt#L238-L246
The suggested modification
@VisibleForTesting
internal fun addMenuItems(
// tab: CustomTabSessionState, // Remove this parameter
menuItems: List<CustomTabMenuItem>,
index: Int,
) {
menuItems.map { item ->
SimpleBrowserMenuItem(item.name) {
sessionId ?. let {
store.state.findCustomTab(it) ?. let {
item.pendingIntent.sendWithUrl(context, it.content.url)
}
}
}
}.also { items ->
There're same issue with functions in this class like addShareButton
, addActionButton
.
addCloseButton
just use tab.id (and it wouldn't change)
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Updated•1 years ago
|
Updated•1 years ago
|
Comment 3•1 years ago
|
||
Authored by https://github.com/jackyzy823
https://github.com/mozilla-mobile/firefox-android/commit/5371e6d22690a936ac0cda43604394bcea7dcd5b
[main] Bug 1831803 - Use getter to access CustomTabSessionState
Description
•