Files
palemoon27/devtools/client/webconsole/test/browser_webconsole_trackingprotection_errors.js
roytam1 e014254710 (WIP) import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1195162 - Move mozapps/plugins into pluginproblem (r=sicking,bsmedberg) (d080fe2710)
- align to TFF (c66d720b12)
- further profiler removal (6b056d54d5)
- Bug 1172500 - Add a keyboard shortcut to minimize the toolbox. r=jryans (fc832e81da)
- Bug 1198339 - Bind F1 key to open the settings when the toolbox is focused;r=jryans (a2c57c6dac)
- Bug 1119133 - Add a keyboard shortcut to toggle devtools docking mode between last two positions;r=pbrosset (8ed02f37f8)
- Bug 1180663 - Reuse entity names and values from browser.dtd for devtools zoom functionality. r=jryans (bdb7a6abf7)
- missing bit of Bug 1120616 - Part 4 (972e367811)
- Bug 935366 - Use source-map module instead of SourceMap.jsm. r=fitzgen (16e5dba2b7)
- fix misspatch during devtool move (9ac78ebd44)
- Add an unlisten command for stopping any active debugger server instaces (bug 976977). r=jwalker (c75d5d0bd6)
- Rename two gcli strings to ensure localizations are updated (bug 1173301). r=jwalker f=flod (1d61dc0e0e)
- Bug 1129999 - Implement CSP devtool using GCLI; gcli part (r=jwalker) (3ece21b439)
- Bug 1198229 - GCLI: Rename securityDesc in gclicommands.properties to reflect new content. r=ckerschb, r=flod (0cfdb3bf76)
- Bug 1191113 - Add localizable string for security csp in gcli (r=jwalker) (3e5d47b5cc)
- Bug 1186308 - Implement ReferrerPolicy inpsection tool using GCLI. r=ckerschb, r=jwalker (5f9fb339d4)
- Bug 1185072 - CSP devtool in GCLI does not show green icon for upgrade-insecure-requests. r=jwalker (d531cdefdd)
- Bug 1150819 - Fix localization note for Rulers highlighter. r=flod (8437d3090f)
- Bug 1176331 - Create a system module to consolidate usage of fetching device/system/os/constant information. r=jryans (278d15bff5)
- Bug 1171488 - Attach host and client system data to recording profiles r=vp,mossop (67e65307a8)
- Bug 1203748 - Add Windows 10 to DEVTOOLS_OS_ENUMERATED_PER_USER. r=pbrosset (2f36761d46)
- add some missing devtools histograms (96ae9ae7a6)
- Bug 1154809 - remove dead css-parsing code; r=pbrosset (16ac881d15)
- Bug 1136257 - Shift-click to switch between color unit format in place. r=bgrins (c096889705)
- Bug 1154809 - Rewrite prettifyCSS to use CSSLexer. r=pbrosset (9e91577a18)
- remove details not found in TFF/FF48 (9c3a0ee28c)
- Bug 1163183 - Show HTML5 Forms pseudo elements in the rule view. r=bgrins (38f9a52f87)
- Bug 1158634 - Clean up font-inspector.js. r=pbrosset (da756a6f28)
- Bug 987365 - Add pseudo-class lock options to rule view r=bgrins (da34a509e6)
- fix some missing and duplicate histograms (93e7beb400)
- Bug 1177381 - View source from error console uses deprecated API. r=neil (06dfd6aa24)
- Bug 1080302 (part 2) - Convert all mentions of -foo options to --foo options in comments, help messages and error messages. r=glandium. (eecc4d14a3)
- Bug 1164343: Part 2 - Refactor style inspector tests to point to the new context-menu and refactor doc.defaultView to styleWindow r=mikeratcliffe (c95dff2279)
- Bug 1166774 - Wait for rule-view modifications before proceeding to next tests. r=pbrosset,bgrins (a5b5c10153)
- Bug 1158288 - Minimal changes for eslint. r=pbrosse (b54d139ccc)
- Bug 1145162 - Prevent Tooltip class from relaying show/hide events that aren't its own; r=miker (bce745b0c4)
- missing bit of 1158288 (c6f57c5803)
- Bug 1158288 - Show color swatch in drop-shadow function. r=pbrosset (c0de2d7f26)
- Bug 1190047 - [Rule View] Ensure changes to swatches are reverted to the original value on escape r=bgrins (ba40297364)
- Bug 1154809 - rename and clarify last CSS regexp in rule-view.js; r=pbrosset (c79c72e3c3)
- Bug 1157293 - Part 1: Filter styles highlight computed styles. r=bgrins Bug 1157293 - Part 2: Renamed styleinspector-open class to user-open. r=bgrins (cedfc1f9f1)
- Bug 1157293 - Part 3: Use filter-open and user-open attributes instead of classes. r=bgrins (c7c5e102dd)
- add missing (98db81c281)
- Bug 848502 - Add keyboard shortcut to copy selected source URL. r=vporof (8449490f22)
- Bug 867838 - Add the possibility to minimize the bottom-hosted toolbox; r=jryans (7d2e0664ad)
- fix paths (cbfbed7890)
- Bug 1144392 - Show an error message in the Browser Toolbox if the connection fails. r=jryans (bfbff98859)
- some cleanup and dedupe (fdce4c8575)
- Bug 1064596 - Clamp the toolbox size to min(preferred size, available space). r=jryans (5fce754ce4)
- Bug 867838 - Minor eslint code cleanup in toolbox-host.js; r=jryans (4118211be7)
- Bug 1173196 - Add 'transitionend' listener to the toolbox frame before triggering the transition to avoid missing the event. r=pbrosset (668612fbcf)
- missing bit Bug 867838 - Minor eslint code cleanup in toolbox-host.js; r=jryans (f8b5b02b94)
- Bug 1161199 - Remove the now redundant PerformanceActorConnection into the pseudo PerformanceFront. r=vp (ebadb41d61)
- Bug 1184746 - Fixed eslint errors in rule-view.js/computed-view.js, r=mikeratcliffe (b7d076745a)
- Bug 1192561 - Eslint cleanup, formating and removal of aArgs in styleinspector r=bgrins (d04c823ea2)
- Bug 1176595 - Fix eyedropper not working correctly when zoomed. r=jryans (e2fd90a651)
- missing bits of 990741 (e6e762bb74)
- fix build (0219782a2b)
- Bug 1174543 - Part 1: Remove Templater code in computed-view.js r=mratcliffe (2295fc156f)
- Bug 1174543 - Part 2: Clear the matched selector container before rebuilding the matched selectors r=mratcliffe (1606d1d27a)
- missing bits of Bug 1167181 - Wait for computed view to be fully loaded in tests before proceeding to next one. r=pbrosset (633cd9d110)
- Bug 1164343: Part 1 - Extract context-menu logic from rule-view and computed-view to style-inspector-menu r=mikeratcliffe (82bf38df3d)
- Bug 1158506 - [rule view] Filter styles should handle escape keycode correctly r=bgrins Bug 1151943 - Part 1: Add setter for filter style search value r=pbro (df0ac3480e)
- Bug 1152721 - Extract styleinspector common methods to utils.js, r=mratcliffe (c607c4c6f1)
- Bug 1197048 - Part 1: Add strict search for filter styles r=pbro (d391a1ccd4)
- Bug 1188125 - [Rule View] Properties marked overridden does not take into account disabled properties r=bgrins (813666dc03)
- Bug 1120570 - Fix media query in rule view link text. r=bgrins (75cf653e02)
-  Bug 1024693 - [rule view] Copy CSS declarations r=pbrosset (47127e1a75)
- Bug 1187681 - [Rule View] Ensure the property value copied also includes the priority r=mikeratcliffe (51eed0e074)
- Bug 1106272 - Part 2: Change all rule-view events from custom dom events to eventemitter events. r=miker (24ee5c25e3)
- Bug 1106272 - Part 1: Remove the selector highlight on hover and add a selector icon instead. r=miker (11f41e222b)
- Bug 1167669 - Part 1: Refactor the logic for highlighting rule selector, property and stylesheet source r=bgrins (44a2eea1ac)
- Bug 1167669 - Part 2: Highlight new filter style matches when rules and properties are added or modified r=bgrins (e14a1fc009)
- Bug 1189472 - [Rule View] Pseudo-class panel and checkboxes should only be tab focusable when the panel is opened r=bgrins (0280d20fc6)
- Bug 1178535 - Part 2: Highlight pseudoclass and attribute texts in the selector text of the rule view r=bgrins (ad2fae048b)
- Bug 1136101 - Add an "Add rule" button in the rules view toolbar. r=bgrins, ui-r=shorlander (b7104992b8)
- Bug 1155971 - rename userStylesSearch to filterStylesPlaceholder;r=pbrosset (3c58bfee6a)
- Bug 1165032 - Make 'Add new rule' button add a new rule for currently emulated pseudo class locks. r=bgrins (1d250c4256)
- Bug 1198327 - [Rule View] Adding a new unmatched rule should move focus to new property editor r=bgrins (51c388b315)
- Bug 1151943 - Part 2: Add a search button next to overridden properties to filter for similar properties r=pbro (cb5dd5216d)
- Bug 1183792 - [Rule View] Newly added rule should keep a reference to the RuleEditor r=mratcliffe (4f9120272f)
- Bug 1167669 - Part 3: Refactor this.ruleEditor.ruleView to this.ruleView in TextPropertyEditor r=bgrins (13e8d09e33)
- Bug 1187777 - Lazily create computed styles list. r=bgrins (d548b70542)
- Bug 1166344 - [rule view] Store and get the parsed property value displayed in the computed list when filtering styles in the computed list. r=bgrins (84e6131327)
- Bug 1187443 - [Rule View] Remove preview value on start editing of a property r=bgrins (ef297e79ae)
- cleanup after Bug 1152721 (53d4e86317)
- Bug 1159922 - In rule view, update the computed values of a property after editing. r=pbro (9d8ec5dc77)
- Bug 1167174 - Assert that custom highlighter do show the highlighter before proceeding. r=pbrosset (f1fe58151b)
- missing bit of 1192561 (d014e0eb37)
- Bug 1187584 - Don't use the hidden window for creating value nodes in the rule view. r=mratcliffe (33dbc82cf0)
- Bug 971234 - Only apply color swatch depending on cssPropertySupportsType. r=pbrosset (38421c2cfe)
- Bug 1201136 - make output-parser correctly handle special color values. r=bgrins (bdc555db18)
- Bug 1154809 - rewrite output-parser.js to use CSSLexer; r=pbrosset (385d2154dc)
- Bug 1145187 - Add a Poller utility object for togglign on polling functions. r=jryans (1adfc82705)
-  Bu 1196714 - Use require(promise) instead of require(sdk/core/promise). r=jryans (7ff51da6f4)
- Bug 1067325 - Allow DevTools to use view source in tab. r=jsantell (7abe60b5d3)
- Bug 1160774 - Don't wait for 'stylesheet-selected' event in source-utils.js as it is not emitted if the requested sheet is already selected. r=jsantell (a830b90739)
- Bug 1167979 - Remove spidermonkey specific JS from webconsole; r=bgrins (b77d89653c)
- some missing telemetry init, to be sure (e7f9cd6614)
- Bug 1168872 - Support for server side logging; r=panos, ochameau (dbbc83c777)
- Bug 861335 - Link network requests from console to network panel. r=vporof (282de390cf)
- missing bits of Bug 1175040 - Eslint cleanups in styles.js (273bb95e3b)
- Bug 1139058 - Part 1: Allow unmatched rules to be added to the rule view r=pbrosset (c2ae018696)
- Bug 1195343 - update RuleModificationList comments; r=pbrosset (c3473be7f4)
- Bug 1195361 - Add getRuleText. r=pbrosse (66037e3c7a)
- bug 1145049 - Fix nodepicker when reopening toolbox for the same app. r=pbrosset (0ae61c0bc3)
- Bug 1175040 - Add more layout-related properties to the output of getLayout; r=bgrins (bdfae4dac6)
- Bug 1145049 - Cleanup inspector related actors to avoid leaking stuff if any actor is leaked. r=pbrosset (7173d45504)
- Bug 1133205 - Fix SVG style edition in rules view. r=pbrosset (6384613874)
- missing bit of 1145049 (224780f5e3)
- Bug 1036949 - Support for markup view customization. r=pbrosset, r=jryans (de2630c3e3)
- Bug 1186937 - Disconnect MutationObserver instances on Node actor destruction. r=bgrins (21d21debe6)
- Bug 1187482 - Skip XBL and native anonymous content inside non-XUL documents;r=jryans (205a908868)
- Bug 1192536 - Part 1: Make imageToImageData() to wait for the image to load before generating the data-uri. r=pbro (ea82093222)
- Bug 1192536 - Part 2: Tests for InspectorActor.getImageData() and InspctorActor.getImageDataFromURL(). r=pbro (a5bd4830d4)
- Bug 1161072 - Destroy the walker actor on disconnect. r=bgrins (03781eb280)
- Bug 1172164 - Don't allow the walker to start with a node that it doesn't recognize due to a filter;r=pbrosset (1545ea16c0)
- Bug 1161072 - Destroy highlighter actor on disconnect. r=pbrosset (5974055985)
- Bug 984442 - Remove XUL attributes when their attributeName is deleted. r=pbrosset (6d29551468)
- Bug 1122605 - Focus selected inspector node after user selection. r=bgrins (b2d6ebcacf)
- Bug 968241 - Copy outerHTML using keyboard shortcut. r=pbrosset (ebac806995)
- Bug 1195742 - Introduce WalkerActor.has method; r=pbrosset (709904ece1)
- Bug 1170848 - Only record numChildren for childList changes. r=pbrosset (91680fbe1a)
- Bug 1136155 - Alpha-sort events in the events popup r=pbrosset (625dea52cf)
- Bug 873443 - Make the inspector search suggest and select elements in frames; r=bgrins (46d4bdb4d4)
- Bug 1149346 - First word in selector-search also matches classes and ids; r=harth (5f400bab05)
- Bug 1163332 - Add a 'screenshot this node' button to the inspector popup menu. r=pbrosset (31f03dff94)
- Make the web console aware of coneole.timeStamp() (bug 1165489). r=jsantell (2c9e19183a)
- Bug 1170476 - Avoid logging multiple SHA-1 warnings per page (r=past) (0d3d0c1ea6)
- Bug 1184172 - Show stackframe for errors in the webconsole. r=past (36b9c6d9dc)
- Bug 1171298 - Show the ConsoleAPI message prefix in web/browser consoles. r=bgrins,Mossop (22c2d60bdc)
- Bug 1161072 - Ensure webconsole test do have pending request on test end. r=pbrosset (d125e0a900)
- Bug 1142114: Fix broken cases of devtools calling once. r=jsantell (0c483cf48f)
- Bug 1148759 - Ensure that we can inspect objects that reference a Promise; r=past (b7b48094e0)
- align to FF/TFF (fd5a0335f4)
- Bug 1045722 - Increase Console Log Limit. r=bgrins (5924d52721)
- Bug 1170477 - 1 - Quick code cleanup for better eslint compliancy; r=tromey (7a92e5a399)
- Bug 1170477 - 2 - Fix undefined inspector.strings accessor in breadcrumbs; r=tromey (3ede2279ba)
- Bug 1187578 - Avoid infinite loop when creating breadcrumbs. r=bgrins (a354390e05)
- Bug 1198627 - Prevent errors when keyboard navigating inspector breadcrumbs; r=bgrins (1a4c8936e5)
- Bug 1177195 - Include a 'learn more' link on the blocked tracking protection message in the web console;r=fitzgen (8d5f678a13)
- Bug 1191335 - Add a "Learn More" link to HPKP security console messages. r=jryans (c2fbda988f)
- Bug 1157944 - Fix console.dir from obscuring next console call. r=bgrins (d5093d6a08)
- Bug 971967 - Clear sidebar on console refresh. r=bgrins (2c4cd975ed)
- Bug 1193583 - Rename Debugger.evalInGlobal to executeInGlobal. (r=jorendorff) (23273d6ba4)
- Bug 1173385 - Calling $$("") should throw an exception. r=fitzgen (ab9e8fd04e)
- missing bit of Bug 1225828 - Avoid 'Object in compartment marked as invisible to Debugger' exceptions in the Browser Console / Browser Toolbox;r=fitzgen (a6f71f5449)
- Bug 1159725 - Links in markup-view attributes should open with middle-click; r=pbro (708cf09887)
- Bug 1157789 - Add context menu items Expand All / Collapse to markup view. r=janx (a59da7fcc2)
- Bug 1160972 - Minor code cleanup in inspector-panel.js for better consistency; r=miker (e09b63c1fe)
- Bug 1158822 - Link css url attributes to style-editor and js url attributes to debugger; r=jsantell (bdec194154)
- some missing histos (70200dbff0)
2022-07-05 22:37:32 +08:00

49 lines
1.6 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Load a page with tracking elements that get blocked and make sure that a
// 'learn more' link shows up in the webconsole.
"use strict";
const TEST_URI = "http://tracking.example.org/browser/devtools/client/webconsole/test/test-trackingprotection-securityerrors.html";
const LEARN_MORE_URI = "https://developer.mozilla.org/Firefox/Privacy/Tracking_Protection";
const PREF = "privacy.trackingprotection.enabled";
const {UrlClassifierTestUtils} = Cu.import("resource://testing-common/UrlClassifierTestUtils.jsm", {});
registerCleanupFunction(function() {
Services.prefs.clearUserPref(PREF);
UrlClassifierTestUtils.cleanupTestTrackers();
});
add_task(function* testMessagesAppear() {
yield UrlClassifierTestUtils.addTestTrackers();
Services.prefs.setBoolPref(PREF, true);
let { browser } = yield loadTab(TEST_URI);
let hud = yield openConsole();
let results = yield waitForMessages({
webconsole: hud,
messages: [
{
name: "Was blocked because tracking protection is enabled",
text: "The resource at \"http://tracking.example.com/\" was blocked because tracking protection is enabled",
category: CATEGORY_SECURITY,
severity: SEVERITY_WARNING,
objects: true,
},
],
});
yield testClickOpenNewTab(hud, results[0]);
});
function testClickOpenNewTab(hud, match) {
let warningNode = match.clickableElements[0];
ok(warningNode, "link element");
ok(warningNode.classList.contains("learn-more-link"), "link class name");
return simulateMessageLinkClick(warningNode, LEARN_MORE_URI);
}