Guest User

TS3 Exchange Link Fixer

a guest
Apr 29th, 2024
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | Gaming | 0 0
  1. // ==UserScript==
  2. // @name Sims 3 Exchange Link Fixer
  3. // @namespace mailto:[email protected]
  4. // @include http://www.thesims3.com/*
  5. // @include https://www.thesims3.com/*
  6. // @description Repace Sims 3 Exchange Links
  7. // ==/UserScript==
  8.  
  9. (function() {
  10. // Override the downloadAsset and loginAndDownload functions
  11. // which normally pop up a login box
  12. unsafeWindow.downloadAsset = function(assetId) {
  13. document.location='sims3://download/?assetId=' + assetId;
  14. }
  15. unsafeWindow.loginAndDownload = function(theAction,theAssetId) {
  16. document.location='sims3://download/?assetId=' + theAssetId;
  17. }
  18.  
  19. // Override the "save file" link so that it is a direct link
  20. // to the Sims3Pack file :)
  21. function downloadFeaturedAssetsForMembers(assetId,downloadurl)
  22. {
  23. document.getElementById('saveToFileLinkId').href = downloadurl;
  24. }
  25. function updateDownloadCountOpenNewWindow(assetID,downloadurl)
  26. {
  27. document.getElementById('saveToFileLinkId').href = downloadurl;
  28. }
  29. var newline = '';
  30. var bodyTag = parent.wrappedJSObject.document.getElementsByTagName('body')[0];
  31. var allLines = bodyTag.innerHTML.split('\n');
  32. for (var i = 0; i < allLines.length; i++) {
  33. if (allLines[i].indexOf('updateDownloadCountOpenNewWindow') > -1) {
  34. eval(allLines[i]);
  35. }
  36. if (allLines[i].indexOf('downloadFeaturedAssetsForMembers') > -1) {
  37. eval(allLines[i].substring(3));
  38. }
  39. }
  40. })();
Advertisement
Add Comment
Please, Sign In to add comment