Install Tampermonkey extension on your desktop browser.
Install this user script from Greasyfork, and confirm from the popup page.
Open DIM, click on any weapon, the light.gg icon should appear at the top right corner of the popup. Click on that icon to open light.gg page of the weapon in new tab.