[change] Remove automatic addition of 'rel="noopener"' from links

Close #1428
This commit is contained in:
Nicolas Gallagher
2021-02-04 14:33:01 -08:00
parent b7b383098a
commit 956b4a3d74
3 changed files with 0 additions and 14 deletions
@@ -1,7 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`modules/createDOMProps includes "rel" values for "a" elements (to securely open external links) 1`] = `" noopener noreferrer"`;
exports[`modules/createDOMProps includes base reset style for browser-styled elements 1`] = `"css-reset-4rbku5"`;
exports[`modules/createDOMProps includes base reset style for browser-styled elements 2`] = `"css-reset-4rbku5"`;
@@ -330,11 +330,6 @@ describe('modules/createDOMProps', () => {
expect(props['data-testid']).toEqual(testID);
});
test('includes "rel" values for "a" elements (to securely open external links)', () => {
const props = createDOMProps('a', { target: '_blank' });
expect(props.rel).toMatchSnapshot();
});
test('includes cursor style for pressable roles', () => {
expect(createDOMProps('span', { accessibilityRole: 'link' }).className).toMatchSnapshot();
expect(createDOMProps('span', { accessibilityRole: 'button' }).className).toMatchSnapshot();
@@ -210,13 +210,6 @@ const createDOMProps = (component, props) => {
domProps.id = nativeID;
}
// Link security
// https://mathiasbynens.github.io/rel-noopener/
// Note: using "noreferrer" doesn't impact referrer tracking for https
// transfers (i.e., from https to https).
if (component === 'a' && domProps.target === '_blank') {
domProps.rel = `${domProps.rel || ''} noopener noreferrer`;
}
// Automated test IDs
if (testID != null) {
domProps['data-testid'] = testID;