SUBSCRIBE OUR YOUTUBE CHANNEL 👉
Join in Google News
If You Want Adsense Approval for your blog Contact Us Adsense Ready theme Now!

Google Drive Link Generator with direct download link through JavaScript




Hello & Assalaam o aleykum Dear all on this occasion I will share how to make a google drive link a direct download with javascript.

in my previous post, I have shared the google drive generator tool to convert the google drive share link into a direct download link.

The Plan is that I will share this time is that it will automatically change all Google Drive share links that are in the anchor tag into direct download links without having to use a generator again. it will work like magic

Just copy the Javascript below and place it above the code </body> or <!--</body>--></body>

<script>/*<![CDATA[*/
var anchorDrive = document.querySelectorAll('a[href*="drive.google.com"]');
Array.prototype.forEach.call(anchorDrive, function(element, index) {
    element.href = element.href.replace("/file/d/", "/uc?export=download&id=").replace("/view?usp=sharing", "");
});
/*]]>*/</script>

So Now that is all The direct download google drive links with javascript that I can share this time, hopefully it's useful and thank you for visiting.

Hi Greetings! thanks for reaching here, We are so delighted to welcome you on board. Your intelligence and energy make you an asset to your family and love ones.

Post a Comment