Commit 62e9ea2e authored by Robert Knight's avatar Robert Knight

Remove document_url metadata from Sentry reports

This has been replaced by the `hostURL` value in the `host_config`
metadata, which comes from the `#config` fragment. The `hostURL` value
should always contain the full URL, whereas `document_url` gets
truncated to the origin in many browsers. Also the term `hostURL` more
accurately reflects what the value is, since it may be different than
the document for which the client is displaying annotations.
parent 4b36eaf9
......@@ -109,13 +109,6 @@ export function init(config) {
// Ignore errors parsing configuration.
}
// In the sidebar application, it is often useful to know the URL which the
// client was loaded into. This information is usually available in an iframe
// via `document.referrer`. More information about the document is available
// later when frames where the "annotator" code has loaded have connected to
// the sidebar via `postMessage` RPC messages.
Sentry.setExtra('document_url', document.referrer);
/** @param {HTMLScriptElement} script */
const isJavaScript = script =>
!script.type || script.type.match(/javascript|module/);
......
......@@ -125,15 +125,6 @@ describe('sidebar/util/sentry', () => {
assert.neverCalledWith(fakeSentry.setExtra, 'host_config');
});
it('adds "document_url" context to reports', () => {
sentry.init({ dsn: 'test-dsn', environment: 'dev' });
assert.calledWith(
fakeSentry.setExtra,
'document_url',
'https://example.com'
);
});
it('adds "loaded_scripts" context to reports', () => {
sentry.init({ dsn: 'test-dsn', environment: 'dev' });
assert.calledWith(fakeSentry.setExtra, 'loaded_scripts');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment