diff --git a/browser/actors/ClickHandlerParent.jsm b/browser/actors/ClickHandlerParent.jsm
index 7feec8b5aa79..d27f74338c79 100644
--- a/browser/actors/ClickHandlerParent.jsm
+++ b/browser/actors/ClickHandlerParent.jsm
@@ -115,12 +115,6 @@ class ClickHandlerParent extends JSWindowActorParent {
openerBrowser: browser,
// The child ensures that untrusted events have a valid user activation.
hasValidUserGestureActivation: true,
- globalHistoryOptions: {
- triggeringSponsoredURL: browser.getAttribute("triggeringSponsoredURL"),
- triggeringSponsoredURLVisitTimeMS: browser.getAttribute(
- "triggeringSponsoredURLVisitTimeMS"
- ),
- },
};
// The new tab/window must use the same userContextId.
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index b5bde130e122..4f20641c2af5 100644
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1470,7 +1470,6 @@ function _loadURI(browser, uri, params = {}) {
csp,
remoteTypeOverride,
hasValidUserGestureActivation,
- globalHistoryOptions,
} = params || {};
let loadFlags =
params.loadFlags || params.flags || Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
@@ -1510,17 +1509,6 @@ function _loadURI(browser, uri, params = {}) {
// XXX(nika): Is `browser.isNavigating` necessary anymore?
browser.isNavigating = true;
-
- if (globalHistoryOptions?.triggeringSponsoredURL) {
- browser.setAttribute(
- "triggeringSponsoredURL",
- globalHistoryOptions.triggeringSponsoredURL
- );
- const time =
- globalHistoryOptions.triggeringSponsoredURLVisitTimeMS || Date.now();
- browser.setAttribute("triggeringSponsoredURLVisitTimeMS", time);
- }
-
let loadURIOptions = {
triggeringPrincipal,
csp,
diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js
index 74b1681528cd..b7c2fa234696 100644
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -1405,14 +1405,6 @@ class nsContextMenu {
openLinkInTab(event) {
let params = {
userContextId: parseInt(event.target.getAttribute("data-usercontextid")),
- globalHistoryOptions: {
- triggeringSponsoredURL: this.browser.getAttribute(
- "triggeringSponsoredURL"
- ),
- triggeringSponsoredURLVisitTimeMS: this.browser.getAttribute(
- "triggeringSponsoredURLVisitTimeMS"
- ),
- },
};
openLinkIn(this.linkURL, "tab", this._openLinkInParameters(params));
diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js
index 66306fad25f8..c97fed4fdc6c 100644
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -1660,7 +1660,6 @@
var aName;
var aCsp;
var aSkipLoad;
- var aGlobalHistoryOptions;
if (
arguments.length == 2 &&
typeof arguments[1] == "object" &&
@@ -1690,7 +1689,6 @@
aName = params.name;
aCsp = params.csp;
aSkipLoad = params.skipLoad;
- aGlobalHistoryOptions = params.globalHistoryOptions;
}
// all callers of loadOneTab need to pass a valid triggeringPrincipal.
@@ -1730,7 +1728,6 @@
name: aName,
csp: aCsp,
skipLoad: aSkipLoad,
- globalHistoryOptions: aGlobalHistoryOptions,
});
if (!bgLoad) {
this.selectedTab = tab;
@@ -2588,7 +2585,6 @@
csp,
skipLoad,
batchInsertingTabs,
- globalHistoryOptions,
} = {}
) {
// all callers of addTab that pass a params object need to pass
@@ -2920,7 +2916,6 @@
charset,
postData,
csp,
- globalHistoryOptions,
});
} catch (ex) {
Cu.reportError(ex);
diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js
index 4642ab7bf30f..668f09c2ac35 100644
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -307,7 +307,6 @@ function openLinkIn(url, where, params) {
var aResolveOnNewTabCreated = params.resolveOnNewTabCreated;
// This callback will be called with the content browser once it's created.
var aResolveOnContentBrowserReady = params.resolveOnContentBrowserCreated;
- var aGlobalHistoryOptions = params.globalHistoryOptions;
if (!aTriggeringPrincipal) {
throw new Error("Must load with a triggering Principal");
@@ -609,7 +608,6 @@ function openLinkIn(url, where, params) {
postData: aPostData,
userContextId: aUserContextId,
hasValidUserGestureActivation: params.hasValidUserGestureActivation,
- globalHistoryOptions: aGlobalHistoryOptions,
});
if (aResolveOnContentBrowserReady) {
aResolveOnContentBrowserReady(targetBrowser);
@@ -647,7 +645,6 @@ function openLinkIn(url, where, params) {
focusUrlBar,
openerBrowser: params.openerBrowser,
fromExternal: params.fromExternal,
- globalHistoryOptions: aGlobalHistoryOptions,
});
targetBrowser = tabUsedForLoad.linkedBrowser;
diff --git a/browser/components/newtab/lib/PlacesFeed.jsm b/browser/components/newtab/lib/PlacesFeed.jsm
index dc7260912fa4..2f135d01dbaa 100644
--- a/browser/components/newtab/lib/PlacesFeed.jsm
+++ b/browser/components/newtab/lib/PlacesFeed.jsm
@@ -279,11 +279,6 @@ class PlacesFeed {
private: isPrivate,
targetBrowser: action._target.browser,
fromChrome: false, // This ensure we maintain user preference for how to open new tabs.
- globalHistoryOptions: {
- triggeringSponsoredURL: action.data.sponsored_tile_id
- ? action.data.url
- : undefined,
- },
};
// Always include the referrer (even for http links) if we have one
diff --git a/browser/components/newtab/test/browser/annotation_first.html b/browser/components/newtab/test/browser/annotation_first.html
deleted file mode 100644
index e40ed1db6cbf..000000000000
--- a/browser/components/newtab/test/browser/annotation_first.html
+++ /dev/null
@@ -1,2 +0,0 @@
-first
-goto second
diff --git a/browser/components/newtab/test/browser/annotation_second.html b/browser/components/newtab/test/browser/annotation_second.html
deleted file mode 100644
index 8d8bbab6bd7c..000000000000
--- a/browser/components/newtab/test/browser/annotation_second.html
+++ /dev/null
@@ -1,2 +0,0 @@
-second
-goto third
diff --git a/browser/components/newtab/test/browser/annotation_third.html b/browser/components/newtab/test/browser/annotation_third.html
deleted file mode 100644
index b63f85fe1f9f..000000000000
--- a/browser/components/newtab/test/browser/annotation_third.html
+++ /dev/null
@@ -1,2 +0,0 @@
-thrid
-goto outside
diff --git a/browser/components/newtab/test/browser/browser.ini b/browser/components/newtab/test/browser/browser.ini
index ecdfcfa0b51c..a498c32c92f9 100644
--- a/browser/components/newtab/test/browser/browser.ini
+++ b/browser/components/newtab/test/browser/browser.ini
@@ -2,11 +2,7 @@
support-files =
blue_page.html
red_page.html
- annotation_first.html
- annotation_second.html
- annotation_third.html
head.js
- redirect_to.sjs
snippet.json
snippet_below_search_test.json
snippet_simple_test.json
@@ -66,7 +62,6 @@ support-files=
[browser_open_tab_focus.js]
skip-if = (os == "linux") # Test setup only implemented for OSX and Windows
[browser_remote_l10n.js]
-[browser_topsites_annotation.js]
[browser_topsites_contextMenu_options.js]
[browser_topsites_section.js]
skip-if =
diff --git a/browser/components/newtab/test/browser/browser_topsites_annotation.js b/browser/components/newtab/test/browser/browser_topsites_annotation.js
deleted file mode 100644
index 52f37c893fb4..000000000000
--- a/browser/components/newtab/test/browser/browser_topsites_annotation.js
+++ /dev/null
@@ -1,452 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Test whether a visit information is annotated correctly when clicking a tile.
-
-if (AppConstants.platform === "macosx") {
- requestLongerTimeout(2);
-}
-
-const { XPCOMUtils } = ChromeUtils.import(
- "resource://gre/modules/XPCOMUtils.jsm"
-);
-XPCOMUtils.defineLazyModuleGetters(this, {
- NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
- PlacesTestUtils: "resource://testing-common/PlacesTestUtils.jsm",
- UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.jsm",
-});
-
-const OPEN_TYPE = {
- CURRENT_BY_CLICK: 0,
- NEWTAB_BY_CLICK: 1,
- NEWTAB_BY_CONTEXTMENU: 2,
-};
-
-const { VISIT_SOURCE_ORGANIC, VISIT_SOURCE_SPONSORED } = PlacesUtils.history;
-
-async function assertDatabase({ targetURL, expected }) {
- const placesId = await PlacesTestUtils.fieldInDB(targetURL, "id");
- const expectedTriggeringPlaceId = expected.triggerURL
- ? await PlacesTestUtils.fieldInDB(expected.triggerURL, "id")
- : null;
- const db = await PlacesUtils.promiseDBConnection();
- const rows = await db.execute(
- "SELECT source, triggeringPlaceId FROM moz_historyvisits WHERE place_id = :place_id AND source = :source",
- {
- place_id: placesId,
- source: expected.source,
- }
- );
- Assert.equal(rows.length, 1);
- Assert.equal(
- rows[0].getResultByName("triggeringPlaceId"),
- expectedTriggeringPlaceId,
- `The triggeringPlaceId in database is correct for ${targetURL}`
- );
-}
-
-async function openAndTest({
- linkSelector,
- linkURL,
- redirectTo = null,
- openType = OPEN_TYPE.CURRENT_BY_CLICK,
- expected,
-}) {
- const destinationURL = redirectTo || linkURL;
-
- info("Open specific link and wait for loading.");
- const isNewTab = openType !== OPEN_TYPE.CURRENT_BY_CLICK;
- const onLoad = isNewTab
- ? BrowserTestUtils.waitForNewTab(gBrowser, destinationURL, true)
- : BrowserTestUtils.browserLoaded(
- gBrowser.selectedBrowser,
- false,
- destinationURL
- );
-
- // If nodeIconChanged of browserPlacesViews.js is called after the target node
- // is lost during test, "No DOM node set for aPlacesNode" error occur. To avoid
- // this failure, wait for the onLocationChange event that triggers
- // nodeIconChanged to occur.
- const onLocationChanged = new Promise(resolve => {
- gBrowser.addTabsProgressListener({
- async onLocationChange(aBrowser, aWebProgress, aRequest, aLocation) {
- if (aLocation.spec === destinationURL) {
- gBrowser.removeTabsProgressListener(this);
- // Wait for an empty Promise to ensure to proceed our test after
- // finishing the processing of other onLocatoinChanged events.
- await Promise.resolve();
- resolve();
- }
- },
- });
- });
-
- // Wait for content is ready.
- await SpecialPowers.spawn(
- gBrowser.selectedBrowser,
- [linkSelector, linkURL],
- async (selector, link) => {
- await ContentTaskUtils.waitForCondition(
- () => content.document.querySelector(selector).href === link
- );
- }
- );
-
- // Open the link by type.
- if (openType === OPEN_TYPE.NEWTAB_BY_CLICK) {
- await BrowserTestUtils.synthesizeMouseAtCenter(
- linkSelector,
- { ctrlKey: isNewTab, metaKey: isNewTab },
- gBrowser.selectedBrowser
- );
- } else if (openType === OPEN_TYPE.NEWTAB_BY_CONTEXTMENU) {
- const onPopup = BrowserTestUtils.waitForEvent(document, "popupshown");
- await BrowserTestUtils.synthesizeMouseAtCenter(
- linkSelector,
- { type: "contextmenu" },
- gBrowser.selectedBrowser
- );
- await onPopup;
- const contextMenu = document.getElementById("contentAreaContextMenu");
- const openLinkMenuItem = contextMenu.querySelector(
- "#context-openlinkintab"
- );
- openLinkMenuItem.click();
- contextMenu.hidePopup();
- } else {
- await BrowserTestUtils.synthesizeMouseAtCenter(
- linkSelector,
- {},
- gBrowser.selectedBrowser
- );
- }
-
- const maybeNewTab = await onLoad;
- await onLocationChanged;
-
- if (isNewTab) {
- BrowserTestUtils.removeTab(maybeNewTab);
- }
-
- info("Check database for the destination.");
- await assertDatabase({ targetURL: destinationURL, expected });
-}
-
-async function pin(link) {
- // Setup test tile.
- NewTabUtils.pinnedLinks.pin(link, 0);
- await toggleTopsitesPref();
- await BrowserTestUtils.waitForCondition(() => {
- const sites = AboutNewTab.getTopSites();
- return (
- sites?.[0]?.url === link.url &&
- sites[0].sponsored_tile_id === link.sponsored_tile_id
- );
- }, "Waiting for top sites to be updated");
-}
-
-function unpin(link) {
- NewTabUtils.pinnedLinks.unpin(link);
-}
-
-add_setup(async function() {
- await clearHistoryAndBookmarks();
- registerCleanupFunction(async () => {
- await clearHistoryAndBookmarks();
- });
-});
-
-add_task(async function basic() {
- const testData = [
- {
- description: "Sponsored tile",
- link: {
- label: "test_label",
- url: "http://example.com/",
- sponsored_position: 1,
- sponsored_tile_id: 12345,
- sponsored_impression_url: "http://impression.example.com/",
- sponsored_click_url: "http://click.example.com/",
- },
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- },
- },
- {
- description: "Organic tile",
- link: {
- label: "test_label",
- url: "http://example.com/",
- },
- expected: {
- source: VISIT_SOURCE_ORGANIC,
- },
- },
- ];
-
- for (const { description, link, expected } of testData) {
- info(description);
-
- await BrowserTestUtils.withNewTab("about:home", async () => {
- // Setup test tile.
- await pin(link);
-
- // Test with new tab.
- await openAndTest({
- linkSelector: ".top-site-button",
- linkURL: link.url,
- openType: OPEN_TYPE.NEWTAB_BY_CLICK,
- expected,
- });
-
- await clearHistoryAndBookmarks();
-
- // Test with same tab.
- await openAndTest({
- linkSelector: ".top-site-button",
- linkURL: link.url,
- expected,
- });
- await clearHistoryAndBookmarks();
-
- unpin(link);
- });
- }
-});
-
-add_task(async function redirection() {
- await BrowserTestUtils.withNewTab("about:home", async () => {
- const redirectTo = "http://example.com/";
- const link = {
- label: "test_label",
- url:
- "http://example.com/browser/browser/components/newtab/test/browser/redirect_to.sjs?/",
- sponsored_position: 1,
- sponsored_tile_id: 12345,
- sponsored_impression_url: "http://impression.example.com/",
- sponsored_click_url: "http://click.example.com/",
- };
-
- // Setup test tile.
- await pin(link);
-
- // Test with new tab.
- await openAndTest({
- linkSelector: ".top-site-button",
- linkURL: link.url,
- redirectTo,
- openType: OPEN_TYPE.NEWTAB_BY_CLICK,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- triggerURL: link.url,
- },
- });
-
- // Check for URL causes the redirection.
- await assertDatabase({
- targetURL: link.url,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- },
- });
- await clearHistoryAndBookmarks();
-
- // Test with same tab.
- await openAndTest({
- linkSelector: ".top-site-button",
- linkURL: link.url,
- redirectTo,
- openType: OPEN_TYPE.NEWTAB_BY_CLICK,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- triggerURL: link.url,
- },
- });
- // Check for URL causes the redirection.
- await assertDatabase({
- targetURL: link.url,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- },
- });
- await clearHistoryAndBookmarks();
- unpin(link);
- });
-});
-
-add_task(async function inherit() {
- const host = "https://example.com/";
- const sameBaseDomainHost = "https://www.example.com/";
- const path = "browser/browser/components/newtab/test/browser/";
- const firstURL = `${host}${path}annotation_first.html`;
- const secondURL = `${host}${path}annotation_second.html`;
- const thirdURL = `${sameBaseDomainHost}${path}annotation_third.html`;
- const outsideURL = "https://example.org/";
-
- await BrowserTestUtils.withNewTab("about:home", async () => {
- const link = {
- label: "first",
- url: firstURL,
- sponsored_position: 1,
- sponsored_tile_id: 12345,
- sponsored_impression_url: "http://impression.example.com/",
- sponsored_click_url: "http://click.example.com/",
- };
-
- // Setup test tile.
- await pin(link);
-
- info("Open the tile to show first page in same tab");
- await openAndTest({
- linkSelector: ".top-site-button",
- linkURL: link.url,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- },
- });
-
- info("Open link on first page to show second page in new tab");
- await openAndTest({
- linkSelector: "a",
- linkURL: secondURL,
- openType: OPEN_TYPE.NEWTAB_BY_CLICK,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- triggerURL: link.url,
- },
- });
- await PlacesTestUtils.clearHistoryVisits();
-
- info("Open link on first page to show second page in same tab");
- await openAndTest({
- linkSelector: "a",
- linkURL: secondURL,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- triggerURL: link.url,
- },
- });
-
- info(
- "Open link on second page to show third page in new tab by context menu"
- );
- await openAndTest({
- linkSelector: "a",
- linkURL: thirdURL,
- openType: OPEN_TYPE.NEWTAB_BY_CONTEXTMENU,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- triggerURL: link.url,
- },
- });
- await PlacesTestUtils.clearHistoryVisits();
-
- info("Open link on second page to show third page in same tab");
- await openAndTest({
- linkSelector: "a",
- linkURL: thirdURL,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- triggerURL: link.url,
- },
- });
-
- info("Open link on third page to show outside domain page in same tab");
- await openAndTest({
- linkSelector: "a",
- linkURL: outsideURL,
- expected: {
- source: VISIT_SOURCE_ORGANIC,
- },
- });
-
- info("Visit URL that has the same domain as sponsored link from URL bar");
- const onLoad = BrowserTestUtils.browserLoaded(
- gBrowser.selectedBrowser,
- false,
- host
- );
- await UrlbarTestUtils.promiseAutocompleteResultPopup({
- window,
- value: host,
- waitForFocus: SimpleTest.waitForFocus,
- });
- EventUtils.synthesizeKey("KEY_Enter");
- await onLoad;
- await assertDatabase({
- targetURL: host,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- triggerURL: link.url,
- },
- });
-
- unpin(link);
- await clearHistoryAndBookmarks();
- });
-});
-
-add_task(async function timeout() {
- const base =
- "https://example.com/browser/browser/components/newtab/test/browser";
- const firstURL = `${base}/annotation_first.html`;
- const secondURL = `${base}/annotation_second.html`;
-
- await BrowserTestUtils.withNewTab("about:home", async () => {
- info("Set timeout second");
- await SpecialPowers.pushPrefEnv({
- set: [["places.sponsoredSession.timeOutSec", 1]],
- });
-
- const link = {
- label: "test",
- url: firstURL,
- sponsored_position: 1,
- sponsored_tile_id: 12345,
- sponsored_impression_url: "http://impression.example.com/",
- sponsored_click_url: "http://click.example.com/",
- };
-
- // Setup a test tile.
- await pin(link);
-
- info("Open the tile");
- await openAndTest({
- linkSelector: ".top-site-button",
- linkURL: link.url,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- },
- });
-
- info("Wait 1 sec");
- // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
- await new Promise(r => setTimeout(r, 1000));
-
- info("Open link on first page to show second page in new tab");
- await openAndTest({
- linkSelector: "a",
- linkURL: secondURL,
- openType: OPEN_TYPE.NEWTAB_BY_CLICK,
- expected: {
- source: VISIT_SOURCE_ORGANIC,
- },
- });
- await PlacesTestUtils.clearHistoryVisits();
-
- info("Open link on first page to show second page");
- await openAndTest({
- linkSelector: "a",
- linkURL: secondURL,
- expected: {
- source: VISIT_SOURCE_ORGANIC,
- },
- });
-
- unpin(link);
- await clearHistoryAndBookmarks();
- });
-});
diff --git a/browser/components/newtab/test/browser/redirect_to.sjs b/browser/components/newtab/test/browser/redirect_to.sjs
deleted file mode 100644
index b52ebdc63e1a..000000000000
--- a/browser/components/newtab/test/browser/redirect_to.sjs
+++ /dev/null
@@ -1,9 +0,0 @@
-"use strict";
-
-function handleRequest(request, response) {
- // redirect_to.sjs?ctxmenu-image.png
- // redirects to : ctxmenu-image.png
- const redirectUrl = request.queryString;
- response.setStatusLine(request.httpVersion, "302", "Found");
- response.setHeader("Location", redirectUrl, false);
-}
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index b4c390765fef..433011784857 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -802,11 +802,6 @@ export class UrlbarInput {
let where = this._whereToOpen(event);
let openParams = {
allowInheritPrincipal: false,
- globalHistoryOptions: {
- triggeringSponsoredURL: result.payload?.isSponsored
- ? result.payload.url
- : undefined,
- },
};
if (
diff --git a/browser/components/urlbar/tests/browser/browser.ini b/browser/components/urlbar/tests/browser/browser.ini
index c6060a5b8533..1d3f02925d9f 100644
--- a/browser/components/urlbar/tests/browser/browser.ini
+++ b/browser/components/urlbar/tests/browser/browser.ini
@@ -302,9 +302,6 @@ https_first_disabled = true
[browser_unitConversion.js]
[browser_updateForDomainCompletion.js]
https_first_disabled = true
-[browser_urlbar_annotation.js]
-support-files =
- redirect_to.sjs
[browser_urlbar_event_telemetry_abandonment.js]
support-files =
searchSuggestionEngine.xml
diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_annotation.js b/browser/components/urlbar/tests/browser/browser_urlbar_annotation.js
deleted file mode 100644
index a493ffc2c30f..000000000000
--- a/browser/components/urlbar/tests/browser/browser_urlbar_annotation.js
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Test whether a visit information is annotated correctly when picking a result.
-
-const { VISIT_SOURCE_ORGANIC, VISIT_SOURCE_SPONSORED } = PlacesUtils.history;
-
-async function assertDatabase({ targetURL, expected }) {
- const placesId = await PlacesTestUtils.fieldInDB(targetURL, "id");
- const expectedTriggeringPlaceId = expected.triggerURL
- ? await PlacesTestUtils.fieldInDB(expected.triggerURL, "id")
- : null;
- const db = await PlacesUtils.promiseDBConnection();
- const rows = await db.execute(
- "SELECT source, triggeringPlaceId FROM moz_historyvisits WHERE place_id = :place_id AND source = :source",
- {
- place_id: placesId,
- source: expected.source,
- }
- );
- Assert.equal(rows.length, 1);
- Assert.equal(
- rows[0].getResultByName("triggeringPlaceId"),
- expectedTriggeringPlaceId,
- `The triggeringPlaceId in database is correct for ${targetURL}`
- );
-}
-
-function registerProvider(payload) {
- const provider = new UrlbarTestUtils.TestProvider({
- results: [
- new UrlbarResult(
- UrlbarUtils.RESULT_TYPE.URL,
- UrlbarUtils.RESULT_SOURCE.SEARCH,
- ...UrlbarResult.payloadAndSimpleHighlights([], {
- ...payload,
- })
- ),
- ],
- priority: Infinity,
- });
- UrlbarProvidersManager.registerProvider(provider);
- return provider;
-}
-
-async function pickResult({ input, payloadURL, redirectTo }) {
- const destinationURL = redirectTo || payloadURL;
- await UrlbarTestUtils.promiseAutocompleteResultPopup({
- window,
- value: input,
- fireInputEvent: true,
- });
-
- const result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
- Assert.equal(result.url, payloadURL);
- UrlbarTestUtils.setSelectedRowIndex(window, 0);
-
- info("Show result and wait for loading");
- const onLoad = BrowserTestUtils.browserLoaded(
- gBrowser.selectedBrowser,
- false,
- destinationURL
- );
- EventUtils.synthesizeKey("KEY_Enter");
- await onLoad;
-}
-
-add_setup(async function() {
- await PlacesUtils.history.clear();
- await PlacesUtils.bookmarks.eraseEverything();
- registerCleanupFunction(async () => {
- await PlacesUtils.history.clear();
- await PlacesUtils.bookmarks.eraseEverything();
- });
-});
-
-add_task(async function basic() {
- const testData = [
- {
- description: "Sponsored result",
- input: "exa",
- payload: {
- url: "http://example.com/",
- isSponsored: true,
- },
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- },
- },
- {
- description: "Organic result",
- input: "exa",
- payload: {
- url: "http://example.com/",
- },
- expected: {
- source: VISIT_SOURCE_ORGANIC,
- },
- },
- ];
-
- for (const { description, input, payload, expected } of testData) {
- info(description);
- const provider = registerProvider(payload);
-
- await BrowserTestUtils.withNewTab("about:blank", async () => {
- info("Pick result");
- await pickResult({ input, payloadURL: payload.url });
-
- info("Check database");
- await assertDatabase({ targetURL: payload.url, expected });
- });
-
- UrlbarProvidersManager.unregisterProvider(provider);
- await PlacesUtils.history.clear();
- await PlacesUtils.bookmarks.eraseEverything();
- }
-});
-
-add_task(async function redirection() {
- const redirectTo = "http://example.com/";
- const payload = {
- url:
- "http://example.com/browser/browser/components/urlbar/tests/browser/redirect_to.sjs?/",
- isSponsored: true,
- };
- const input = "exa";
- const provider = registerProvider(payload);
-
- await BrowserTestUtils.withNewTab("about:home", async () => {
- info("Pick result");
- await pickResult({ input, payloadURL: payload.url, redirectTo });
-
- info("Check database");
- await assertDatabase({
- targetURL: payload.url,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- },
- });
- await assertDatabase({
- targetURL: redirectTo,
- expected: {
- source: VISIT_SOURCE_SPONSORED,
- triggerURL: payload.url,
- },
- });
- });
-
- await PlacesUtils.history.clear();
- await PlacesUtils.bookmarks.eraseEverything();
- UrlbarProvidersManager.unregisterProvider(provider);
-});
diff --git a/browser/components/urlbar/tests/browser/redirect_to.sjs b/browser/components/urlbar/tests/browser/redirect_to.sjs
deleted file mode 100644
index b52ebdc63e1a..000000000000
--- a/browser/components/urlbar/tests/browser/redirect_to.sjs
+++ /dev/null
@@ -1,9 +0,0 @@
-"use strict";
-
-function handleRequest(request, response) {
- // redirect_to.sjs?ctxmenu-image.png
- // redirects to : ctxmenu-image.png
- const redirectUrl = request.queryString;
- response.setStatusLine(request.httpVersion, "302", "Found");
- response.setHeader("Location", redirectUrl, false);
-}
diff --git a/browser/modules/BrowserWindowTracker.jsm b/browser/modules/BrowserWindowTracker.jsm
index 8cf6a3c35f94..ef2db62a8ead 100644
--- a/browser/modules/BrowserWindowTracker.jsm
+++ b/browser/modules/BrowserWindowTracker.jsm
@@ -214,17 +214,6 @@ const BrowserWindowTracker = {
return WindowHelper.addWindow(window);
},
- getBrowserById(browserId) {
- for (let win of BrowserWindowTracker.orderedWindows) {
- for (let tab of win.gBrowser.visibleTabs) {
- if (tab.linkedPanel && tab.linkedBrowser.browserId === browserId) {
- return tab.linkedBrowser;
- }
- }
- }
- return null;
- },
-
// For tests only, this function will remove this window from the list of
// tracked windows. Please don't forget to add it back at the end of your
// tests!
diff --git a/docshell/base/IHistory.h b/docshell/base/IHistory.h
index 594ebdb3bb22..8b7b41c2746a 100644
--- a/docshell/base/IHistory.h
+++ b/docshell/base/IHistory.h
@@ -143,11 +143,9 @@ class IHistory : public nsISupports {
* The URI of the last visit in the chain.
* @param aFlags
* The VisitFlags describing this visit.
- * @param aBrowserId
- * The id of browser used for this visit.
*/
NS_IMETHOD VisitURI(nsIWidget* aWidget, nsIURI* aURI, nsIURI* aLastVisitedURI,
- uint32_t aFlags, uint64_t aBrowserId) = 0;
+ uint32_t aFlags) = 0;
/**
* Set the title of the URI.
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index f55212ec8840..e9eb5c80c1ea 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -12374,8 +12374,7 @@ void nsDocShell::SaveLastVisit(nsIChannel* aChannel, nsIURI* aURI,
}
mozilla::Unused << history->VisitURI(aWidget, aURI, aPreviousURI,
- visitURIFlags,
- aBrowsingContext->BrowserId());
+ visitURIFlags);
}
}
diff --git a/dom/ipc/BrowserParent.cpp b/dom/ipc/BrowserParent.cpp
index 59f418dd60fe..f172bf003419 100644
--- a/dom/ipc/BrowserParent.cpp
+++ b/dom/ipc/BrowserParent.cpp
@@ -3894,9 +3894,9 @@ mozilla::ipc::IPCResult BrowserParent::RecvShowCanvasPermissionPrompt(
return IPC_OK();
}
-mozilla::ipc::IPCResult BrowserParent::RecvVisitURI(
- nsIURI* aURI, nsIURI* aLastVisitedURI, const uint32_t& aFlags,
- const uint64_t& aBrowserId) {
+mozilla::ipc::IPCResult BrowserParent::RecvVisitURI(nsIURI* aURI,
+ nsIURI* aLastVisitedURI,
+ const uint32_t& aFlags) {
if (!aURI) {
return IPC_FAIL_NO_REASON(this);
}
@@ -3906,8 +3906,7 @@ mozilla::ipc::IPCResult BrowserParent::RecvVisitURI(
}
nsCOMPtr history = components::History::Service();
if (history) {
- Unused << history->VisitURI(widget, aURI, aLastVisitedURI, aFlags,
- aBrowserId);
+ Unused << history->VisitURI(widget, aURI, aLastVisitedURI, aFlags);
}
return IPC_OK();
}
diff --git a/dom/ipc/BrowserParent.h b/dom/ipc/BrowserParent.h
index 7043dfb31638..713e666b7601 100644
--- a/dom/ipc/BrowserParent.h
+++ b/dom/ipc/BrowserParent.h
@@ -747,8 +747,7 @@ class BrowserParent final : public PBrowserParent,
mozilla::ipc::IPCResult RecvGetSystemFont(nsCString* aFontName);
mozilla::ipc::IPCResult RecvVisitURI(nsIURI* aURI, nsIURI* aLastVisitedURI,
- const uint32_t& aFlags,
- const uint64_t& aBrowserId);
+ const uint32_t& aFlags);
mozilla::ipc::IPCResult RecvQueryVisitedState(
nsTArray>&& aURIs);
diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl
index 8d77105a2f8b..5a344e52dcb7 100644
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -1010,7 +1010,8 @@ parent:
async IsWindowSupportingWebVR(uint64_t aOuterWindowID) returns(bool isSupported);
/** Records a history visit. */
- async VisitURI(nsIURI aURI, nsIURI aLastVisitedURI, uint32_t aFlags, uint64_t aBrowserId);
+ async VisitURI(nsIURI aURI, nsIURI aLastVisitedURI,
+ uint32_t aFlags);
/** Fetches the visited status for an array of URIs (Android-only). */
async QueryVisitedState(nsIURI[] aURIs);
diff --git a/mobile/android/components/geckoview/GeckoViewHistory.cpp b/mobile/android/components/geckoview/GeckoViewHistory.cpp
index 9f637f107ada..2aa0181fcce2 100644
--- a/mobile/android/components/geckoview/GeckoViewHistory.cpp
+++ b/mobile/android/components/geckoview/GeckoViewHistory.cpp
@@ -235,8 +235,7 @@ NS_IMPL_ISUPPORTS(OnVisitedCallback, nsIAndroidEventCallback)
NS_IMETHODIMP
GeckoViewHistory::VisitURI(nsIWidget* aWidget, nsIURI* aURI,
- nsIURI* aLastVisitedURI, uint32_t aFlags,
- uint64_t aBrowserId) {
+ nsIURI* aLastVisitedURI, uint32_t aFlags) {
if (!aURI) {
return NS_OK;
}
@@ -253,7 +252,7 @@ GeckoViewHistory::VisitURI(nsIWidget* aWidget, nsIURI* aURI,
return NS_OK;
}
Unused << NS_WARN_IF(
- !browserChild->SendVisitURI(aURI, aLastVisitedURI, aFlags, aBrowserId));
+ !browserChild->SendVisitURI(aURI, aLastVisitedURI, aFlags));
return NS_OK;
}
diff --git a/mobile/android/components/geckoview/GeckoViewHistory.h b/mobile/android/components/geckoview/GeckoViewHistory.h
index a3b96ba58ff2..8976a9787c94 100644
--- a/mobile/android/components/geckoview/GeckoViewHistory.h
+++ b/mobile/android/components/geckoview/GeckoViewHistory.h
@@ -33,7 +33,7 @@ class GeckoViewHistory final : public mozilla::BaseHistory {
// IHistory
NS_IMETHOD VisitURI(nsIWidget*, nsIURI*, nsIURI* aLastVisitedURI,
- uint32_t aFlags, uint64_t aBrowserId) final;
+ uint32_t aFlags) final;
NS_IMETHOD SetURITitle(nsIURI*, const nsAString&) final;
static already_AddRefed GetSingleton();
diff --git a/toolkit/components/places/History.cpp b/toolkit/components/places/History.cpp
index c0bf0de74fac..bd88fd1b7233 100644
--- a/toolkit/components/places/History.cpp
+++ b/toolkit/components/places/History.cpp
@@ -34,7 +34,6 @@
#include "mozilla/Unused.h"
#include "nsContentUtils.h" // for nsAutoScriptBlocker
#include "nsJSUtils.h"
-#include "nsStandardURL.h"
#include "mozilla/ipc/URIUtils.h"
#include "nsPrintfCString.h"
#include "nsTHashtable.h"
@@ -49,9 +48,6 @@
#include "mozilla/dom/PlacesVisitTitle.h"
#include "mozilla/dom/ScriptSettings.h"
-#include "nsIBrowserWindowTracker.h"
-#include "nsImportModule.h"
-
using namespace mozilla::dom;
using namespace mozilla::ipc;
using mozilla::Unused;
@@ -86,15 +82,9 @@ struct VisitData {
referrerVisitId(0),
titleChanged(false),
shouldUpdateFrecency(true),
- useFrecencyRedirectBonus(false),
- source(nsINavHistoryService::VISIT_SOURCE_ORGANIC),
- triggeringPlaceId(0),
- triggeringSponsoredURLVisitTimeMS(0) {
+ useFrecencyRedirectBonus(false) {
guid.SetIsVoid(true);
title.SetIsVoid(true);
- baseDomain.SetIsVoid(true);
- triggeringSponsoredURL.SetIsVoid(true);
- triggeringSponsoredURLBaseDomain.SetIsVoid(true);
}
explicit VisitData(nsIURI* aURI, nsIURI* aReferrer = nullptr)
@@ -112,10 +102,7 @@ struct VisitData {
referrerVisitId(0),
titleChanged(false),
shouldUpdateFrecency(true),
- useFrecencyRedirectBonus(false),
- source(nsINavHistoryService::VISIT_SOURCE_ORGANIC),
- triggeringPlaceId(0),
- triggeringSponsoredURLVisitTimeMS(0) {
+ useFrecencyRedirectBonus(false) {
MOZ_ASSERT(aURI);
if (aURI) {
(void)aURI->GetSpec(spec);
@@ -126,9 +113,6 @@ struct VisitData {
}
guid.SetIsVoid(true);
title.SetIsVoid(true);
- baseDomain.SetIsVoid(true);
- triggeringSponsoredURL.SetIsVoid(true);
- triggeringSponsoredURLBaseDomain.SetIsVoid(true);
}
/**
@@ -147,7 +131,6 @@ struct VisitData {
nsCString guid;
int64_t visitId;
nsCString spec;
- nsCString baseDomain;
nsString revHost;
bool hidden;
bool shouldUpdateHidden;
@@ -179,12 +162,6 @@ struct VisitData {
// Whether to override the visit type bonus with a redirect bonus when
// calculating frecency on the most recent visit.
bool useFrecencyRedirectBonus;
-
- uint16_t source;
- int64_t triggeringPlaceId;
- nsCString triggeringSponsoredURL;
- nsCString triggeringSponsoredURLBaseDomain;
- int64_t triggeringSponsoredURLVisitTimeMS;
};
////////////////////////////////////////////////////////////////////////////////
@@ -926,7 +903,6 @@ class InsertVisitedURIs final : public Runnable {
}
FetchReferrerInfo(place);
- UpdateVisitSource(place, mHistory);
nsresult rv = DoDatabaseInserts(known, place);
if (!!mCallback) {
@@ -1021,11 +997,6 @@ class InsertVisitedURIs final : public Runnable {
"Passed a VisitData with a URI we cannot add to history!");
}
#endif
-
- // Need to get session timeout pref here since static call for Preferences
- // should run on main thread.
- mSponsoredSessionTimeoutSec = Preferences::GetUint(
- "places.sponsoredSession.timeOutSec", 3600 /* Default 1 hour */);
}
/**
@@ -1122,10 +1093,8 @@ class InsertVisitedURIs final : public Runnable {
nsCOMPtr stmt;
stmt = mHistory->GetStatement(
"INSERT INTO moz_historyvisits "
- "(from_visit, place_id, visit_date, visit_type, session, source, "
- "triggeringPlaceId) "
- "VALUES (:from_visit, :page_id, :visit_date, :visit_type, 0, :source, "
- ":triggeringPlaceId) ");
+ "(from_visit, place_id, visit_date, visit_type, session) "
+ "VALUES (:from_visit, :page_id, :visit_date, :visit_type, 0) ");
NS_ENSURE_STATE(stmt);
mozStorageStatementScoper scoper(stmt);
@@ -1141,15 +1110,6 @@ class InsertVisitedURIs final : public Runnable {
"Invalid transition type!");
rv = stmt->BindInt32ByName("visit_type"_ns, transitionType);
NS_ENSURE_SUCCESS(rv, rv);
- rv = stmt->BindInt32ByName("source"_ns, _place.source);
- NS_ENSURE_SUCCESS(rv, rv);
- if (_place.triggeringPlaceId != 0) {
- rv = stmt->BindInt64ByName("triggeringPlaceId"_ns,
- _place.triggeringPlaceId);
- } else {
- rv = stmt->BindNullByName("triggeringPlaceId"_ns);
- }
- NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->Execute();
NS_ENSURE_SUCCESS(rv, rv);
@@ -1209,59 +1169,6 @@ class InsertVisitedURIs final : public Runnable {
return NS_OK;
}
- nsresult UpdateVisitSource(VisitData& aPlace, History* aHistory) {
- aPlace.source = nsINavHistoryService::VISIT_SOURCE_ORGANIC;
-
- if (aPlace.triggeringSponsoredURL.IsEmpty()) {
- // No triggeringSponsoredURL.
- return NS_OK;
- }
-
- if ((aPlace.visitTime -
- aPlace.triggeringSponsoredURLVisitTimeMS * PR_USEC_PER_MSEC) >
- mSponsoredSessionTimeoutSec * PR_USEC_PER_SEC) {
- // Sponsored session timeout.
- return NS_OK;
- }
-
- if (aPlace.spec.Equals(aPlace.triggeringSponsoredURL)) {
- // This place is the triggeringSponsoredURL.
- aPlace.source = nsINavHistoryService::VISIT_SOURCE_SPONSORED;
- return NS_OK;
- }
-
- if (!aPlace.baseDomain.Equals(aPlace.triggeringSponsoredURLBaseDomain)) {
- // The base domain is not same.
- return NS_OK;
- }
-
- nsCOMPtr stmt;
- stmt = aHistory->GetStatement(
- "SELECT id FROM moz_places h "
- "WHERE url_hash = hash(:url) AND url = :url");
- NS_ENSURE_STATE(stmt);
- nsresult rv =
- URIBinder::Bind(stmt, "url"_ns, aPlace.triggeringSponsoredURL);
- NS_ENSURE_SUCCESS(rv, rv);
-
- mozStorageStatementScoper scoper(stmt);
-
- bool exists;
- rv = stmt->ExecuteStep(&exists);
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (!exists) {
- // Not in sponsored session since no history.
- return NS_OK;
- }
-
- rv = stmt->GetInt64(0, &aPlace.triggeringPlaceId);
- NS_ENSURE_SUCCESS(rv, rv);
- aPlace.source = nsINavHistoryService::VISIT_SOURCE_SPONSORED;
-
- return NS_OK;
- }
-
mozIStorageConnection* mDBConn;
nsTArray mPlaces;
@@ -1274,8 +1181,6 @@ class InsertVisitedURIs final : public Runnable {
uint32_t mSuccessfulUpdatedCount;
- uint32_t mSponsoredSessionTimeoutSec;
-
/**
* Strong reference to the History object because we do not want it to
* disappear out from under us.
@@ -1862,7 +1767,7 @@ void History::AppendToRecentlyVisitedURIs(nsIURI* aURI, bool aHidden) {
NS_IMETHODIMP
History::VisitURI(nsIWidget* aWidget, nsIURI* aURI, nsIURI* aLastVisitedURI,
- uint32_t aFlags, uint64_t aBrowserId) {
+ uint32_t aFlags) {
MOZ_ASSERT(NS_IsMainThread());
NS_ENSURE_ARG(aURI);
@@ -1870,6 +1775,7 @@ History::VisitURI(nsIWidget* aWidget, nsIURI* aURI, nsIURI* aLastVisitedURI,
return NS_OK;
}
+ nsresult rv;
if (XRE_IsContentProcess()) {
if (!BaseHistory::CanStore(aURI)) {
return NS_OK;
@@ -1878,7 +1784,7 @@ History::VisitURI(nsIWidget* aWidget, nsIURI* aURI, nsIURI* aLastVisitedURI,
NS_ENSURE_ARG(aWidget);
BrowserChild* browserChild = aWidget->GetOwningBrowserChild();
NS_ENSURE_TRUE(browserChild, NS_ERROR_FAILURE);
- (void)browserChild->SendVisitURI(aURI, aLastVisitedURI, aFlags, aBrowserId);
+ (void)browserChild->SendVisitURI(aURI, aLastVisitedURI, aFlags);
return NS_OK;
}
@@ -1887,7 +1793,7 @@ History::VisitURI(nsIWidget* aWidget, nsIURI* aURI, nsIURI* aLastVisitedURI,
// Silently return if URI is something we shouldn't add to DB.
bool canAdd;
- nsresult rv = navHistory->CanAddURI(aURI, &canAdd);
+ rv = navHistory->CanAddURI(aURI, &canAdd);
NS_ENSURE_SUCCESS(rv, rv);
if (!canAdd) {
return NS_OK;
@@ -1974,47 +1880,6 @@ History::VisitURI(nsIWidget* aWidget, nsIURI* aURI, nsIURI* aLastVisitedURI,
}
}
- nsCOMPtr bwt =
- do_ImportModule("resource:///modules/BrowserWindowTracker.jsm",
- "BrowserWindowTracker", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
- nsCOMPtr browser;
- rv = bwt->GetBrowserById(aBrowserId, getter_AddRefs(browser));
- NS_ENSURE_SUCCESS(rv, rv);
- if (browser) {
- RefPtr browserElement = static_cast(browser.get());
- nsAutoString triggeringSponsoredURL;
- browserElement->GetAttribute(u"triggeringSponsoredURL"_ns,
- triggeringSponsoredURL);
- if (!triggeringSponsoredURL.IsEmpty()) {
- place.triggeringSponsoredURL.Assign(
- NS_ConvertUTF16toUTF8(triggeringSponsoredURL));
-
- nsAutoString triggeringSponsoredURLVisitTimeMS;
- browserElement->GetAttribute(u"triggeringSponsoredURLVisitTimeMS"_ns,
- triggeringSponsoredURLVisitTimeMS);
- place.triggeringSponsoredURLVisitTimeMS =
- triggeringSponsoredURLVisitTimeMS.ToInteger64(&rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // Get base domain. We need to get it here since nsIEffectiveTLDService
- // referred in DomainNameFromURI should access on main thread.
- nsCOMPtr currentURL;
- rv = NS_MutateURI(new net::nsStandardURL::Mutator())
- .SetSpec(place.spec)
- .Finalize(currentURL);
- NS_ENSURE_SUCCESS(rv, rv);
- nsCOMPtr sponsoredURL;
- rv = NS_MutateURI(new net::nsStandardURL::Mutator())
- .SetSpec(place.triggeringSponsoredURL)
- .Finalize(sponsoredURL);
- NS_ENSURE_SUCCESS(rv, rv);
- navHistory->DomainNameFromURI(currentURL, place.baseDomain);
- navHistory->DomainNameFromURI(sponsoredURL,
- place.triggeringSponsoredURLBaseDomain);
- }
- }
-
// EMBED visits should not go through the database.
// They exist only to keep track of isVisited status during the session.
if (place.transitionType == nsINavHistoryService::TRANSITION_EMBED) {
diff --git a/toolkit/components/places/History.h b/toolkit/components/places/History.h
index 74f606220007..71d77e5a166b 100644
--- a/toolkit/components/places/History.h
+++ b/toolkit/components/places/History.h
@@ -57,7 +57,7 @@ class History final : public BaseHistory,
// IHistory
NS_IMETHOD VisitURI(nsIWidget*, nsIURI*, nsIURI* aLastVisitedURI,
- uint32_t aFlags, uint64_t aBrowserId) final;
+ uint32_t aFlags) final;
NS_IMETHOD SetURITitle(nsIURI*, const nsAString&) final;
// BaseHistory
diff --git a/toolkit/components/places/nsINavHistoryService.idl b/toolkit/components/places/nsINavHistoryService.idl
index 616e9cc48e42..5b7229d399f8 100644
--- a/toolkit/components/places/nsINavHistoryService.idl
+++ b/toolkit/components/places/nsINavHistoryService.idl
@@ -1022,16 +1022,6 @@ interface nsINavHistoryService : nsISupports
*/
const unsigned short DATABASE_STATUS_LOCKED = 4;
- /**
- * Insert this value into moz_historyvisits if the visit source is organic.
- */
- const unsigned short VISIT_SOURCE_ORGANIC = 0;
-
- /**
- * Insert this value into moz_historyvisits if the visit source is sponsored.
- */
- const unsigned short VISIT_SOURCE_SPONSORED = 1;
-
/**
* Returns the current database status
*/
diff --git a/toolkit/components/places/tests/PlacesTestUtils.sys.mjs b/toolkit/components/places/tests/PlacesTestUtils.sys.mjs
index 2f041ead656e..7105f7f3a1c5 100644
--- a/toolkit/components/places/tests/PlacesTestUtils.sys.mjs
+++ b/toolkit/components/places/tests/PlacesTestUtils.sys.mjs
@@ -526,18 +526,6 @@ export var PlacesTestUtils = Object.freeze({
);
},
- /**
- * Clear moz_historyvisits table.
- */
- async clearHistoryVisits() {
- await lazy.PlacesUtils.withConnectionWrapper(
- "test:clearHistoryVisits",
- db => {
- return db.executeCached("DELETE FROM moz_historyvisits");
- }
- );
- },
-
/**
* Compares 2 place: URLs ignoring the order of their params.
* @param url1 First URL to compare
diff --git a/toolkit/components/places/tests/gtest/places_test_harness.h b/toolkit/components/places/tests/gtest/places_test_harness.h
index 4ebe3982bd73..f484503a927a 100644
--- a/toolkit/components/places/tests/gtest/places_test_harness.h
+++ b/toolkit/components/places/tests/gtest/places_test_harness.h
@@ -304,8 +304,8 @@ void do_wait_async_updates() {
void addURI(nsIURI* aURI) {
nsCOMPtr history = do_GetService(NS_IHISTORY_CONTRACTID);
do_check_true(history);
- nsresult rv = history->VisitURI(nullptr, aURI, nullptr,
- mozilla::IHistory::TOP_LEVEL, 0);
+ nsresult rv =
+ history->VisitURI(nullptr, aURI, nullptr, mozilla::IHistory::TOP_LEVEL);
do_check_success(rv);
do_wait_async_updates();
diff --git a/toolkit/components/places/tests/gtest/test_IHistory.cpp b/toolkit/components/places/tests/gtest/test_IHistory.cpp
index 6e64736d2813..3632b49ef9b9 100644
--- a/toolkit/components/places/tests/gtest/test_IHistory.cpp
+++ b/toolkit/components/places/tests/gtest/test_IHistory.cpp
@@ -275,8 +275,7 @@ void test_visituri_inserts() {
nsCOMPtr lastURI = new_test_uri();
nsCOMPtr visitedURI = new_test_uri();
- history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL,
- 0);
+ history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
RefPtr finisher = new VisitURIObserver();
finisher->WaitForNotification();
@@ -298,13 +297,11 @@ void test_visituri_updates() {
nsCOMPtr visitedURI = new_test_uri();
RefPtr finisher;
- history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL,
- 0);
+ history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
finisher = new VisitURIObserver();
finisher->WaitForNotification();
- history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL,
- 0);
+ history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
finisher = new VisitURIObserver();
finisher->WaitForNotification();
@@ -321,11 +318,10 @@ void test_visituri_preserves_shown_and_typed() {
nsCOMPtr lastURI = new_test_uri();
nsCOMPtr visitedURI = new_test_uri();
- history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL,
- 0);
+ history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
// this simulates the uri visit happening in a frame. Normally frame
// transitions would be hidden unless it was previously loaded top-level
- history->VisitURI(nullptr, visitedURI, lastURI, 0, 0);
+ history->VisitURI(nullptr, visitedURI, lastURI, 0);
RefPtr finisher = new VisitURIObserver(2);
finisher->WaitForNotification();
@@ -342,8 +338,7 @@ void test_visituri_creates_visit() {
nsCOMPtr lastURI = new_test_uri();
nsCOMPtr visitedURI = new_test_uri();
- history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL,
- 0);
+ history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
RefPtr finisher = new VisitURIObserver();
finisher->WaitForNotification();
@@ -366,8 +361,7 @@ void test_visituri_transition_typed() {
nsCOMPtr visitedURI = new_test_uri();
navHistory->MarkPageAsTyped(visitedURI);
- history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL,
- 0);
+ history->VisitURI(nullptr, visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
RefPtr finisher = new VisitURIObserver();
finisher->WaitForNotification();
@@ -386,7 +380,7 @@ void test_visituri_transition_embed() {
nsCOMPtr lastURI = new_test_uri();
nsCOMPtr visitedURI = new_test_uri();
- history->VisitURI(nullptr, visitedURI, lastURI, 0, 0);
+ history->VisitURI(nullptr, visitedURI, lastURI, 0);
RefPtr finisher = new VisitURIObserver();
finisher->WaitForNotification();
@@ -406,7 +400,7 @@ void test_new_visit_adds_place_guid() {
nsCOMPtr visitedURI = new_test_uri();
nsCOMPtr history = do_get_IHistory();
nsresult rv = history->VisitURI(nullptr, visitedURI, nullptr,
- mozilla::IHistory::TOP_LEVEL, 0);
+ mozilla::IHistory::TOP_LEVEL);
do_check_success(rv);
RefPtr finisher = new VisitURIObserver();
finisher->WaitForNotification();
diff --git a/toolkit/modules/nsIBrowserWindowTracker.idl b/toolkit/modules/nsIBrowserWindowTracker.idl
index 60c6f5ec2ea4..14169304ca14 100644
--- a/toolkit/modules/nsIBrowserWindowTracker.idl
+++ b/toolkit/modules/nsIBrowserWindowTracker.idl
@@ -17,9 +17,4 @@ interface nsIBrowserWindowTracker : nsISupports
* Return array of browser tabs that are currently visible.
*/
Array getAllVisibleTabs();
-
- /**
- * Return browser having given browser id.
- */
- nsISupports getBrowserById(in uint64_t aBrowserId);
};