Make all external links in Mahara open in external tab/window by default

Bug #1802205 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Wishlist
Robert Lyon

Bug Description

Whether an external <a> link has target=_blank or not we should open them in external tab/window to differentiate mahara site from external content

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/9295

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9295
Committed: https://git.mahara.org/mahara/mahara/commit/ce4e3d8a1f369995f135f8decb41e6fad8e56a42
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit ce4e3d8a1f369995f135f8decb41e6fad8e56a42
Author: Robert Lyon <email address hidden>
Date: Thu Nov 8 13:07:58 2018 +1300

Bug 1802205: All external links to be opened in new tab/window by default

Except for those that have 'target="_self"'

And also have any internal links with 'target="_blank"' to open
externally

Open them in safe noopener way

behatnotneeded

Change-Id: I445034bb2fd2e039c9380dc7a1b29382542e7100
Signed-off-by: Robert Lyon <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/9321

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/9324

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9324
Committed: https://git.mahara.org/mahara/mahara/commit/4bc6994a5e1b00fbd5689cce86fba7891e795c68
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit 4bc6994a5e1b00fbd5689cce86fba7891e795c68
Author: Robert Lyon <email address hidden>
Date: Wed Nov 21 08:03:31 2018 +1300

Bug 1802205: Needing to only handle <a> tags with href attribute

We should ignore the <a name="x"></a> links

behatnotneeded

Change-Id: I3e7031bbb7a7e5da99493ebd36206d4c2d2445a2
Signed-off-by: Robert Lyon <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Steven (stevens-q) wrote :

Title: Make all external links in Mahara open in external tab/window by default

Bug Summary: Whether an external <a> link has target=_blank or not we should open them in external tab/window to differentiate mahara site from external content

Acceptance criteria
--------------------------------------
1. All external links to be opened in new tab/window by default
2. Except for those that have 'target="_self"'
3. And also have any internal links with 'target="_blank"' to open externally
4. Open them in safe no opener way
===========================================

Environment tested: Master
Browser tested: Chrome

Preconditions:
-----------------------------
1. User exists that has access to Group Forum
2. Group exists
3. Forum exists

Test Steps:
-----------------------------
1. Log in as SIte admin
2. Browse to a Group forum
3. Create a new topic Subject = New topic 101
4. In the message WYSIWYG editor - create the following links at the top of the page
-- a. URL = https://www.catalyst.net.nz/ Text to display = catalyst None, Target = None
-- b. URL = https://www.catalyst.net.nz/ Text to display = catalyst same page, Target = same page
-- c. URL = https://www.catalyst.net.nz/ Text to display = catalyst new window, Target = new window
-- d. Existing site page - profile page URL = http://mahara.stevens-lp.dynamic.wgtn.cat-it.co.nz/artefact/internal/index.php Text to display = Profile, Target = None
-- e. Existing site page - profile page URL = http://mahara.stevens-lp.dynamic.wgtn.cat-it.co.nz/artefact/internal/index.php Text to display = Profile, Target = same page
-- f. Existing site page - profile page URL = http://mahara.stevens-lp.dynamic.wgtn.cat-it.co.nz/artefact/internal/index.php Text to display = Profile, Target =new window
5. Enter 8 paragraphs and enter an anchor tag at the bottom of the page
6. create the following links at the top of the page
-- a. URL = #user_cat Text to display = Link to CAT None, Target = None
-- b. URL = #user_cat Text to display = Link to CAT same page, Target = same page
-- c. URL = #user_cat Text to display = Link to CAT new window, Target = new window

Expected result:
--------------------
1. All external links to be opened in new tab/window by default
2. Except for those that have 'target="_self"'
3. And also have any internal links with 'target="_blank"' to open externally
4. Open them in safe no opener way

Actual result: As expected ✔

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Thank you to Recordings Arts Canada for sponsoring this feature.

tags: added: nominatedfeature
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/9321
Committed: https://git.mahara.org/mahara/mahara/commit/05aaf2c0082841fd6f1867d12fcdda2295c24733
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit 05aaf2c0082841fd6f1867d12fcdda2295c24733
Author: Steven Spinelli <email address hidden>
Date: Tue Nov 20 12:05:52 2018 +1300

Behat Bug 1804074 Adding journal entry from Journal block on page
Merge branch 'master' of https://git.mahara.org/mahara/mahara

* 'master' of https://git.mahara.org/mahara/mahara:
Bug 1803616: SyntaxError: expected expression, got ';'
Bug 1802180: Have a simplified group update webservice option
Bug 1800422: Fixed z-index for custom-dropdown
Bug 1803194: Need to include the user object
Bug 1802205: All external links to be opened in new tab/window by default

Change-Id: Ibe0898d9326c0527cc6a4e937da9782b00c10eb0

Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.