Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Sims 3 Exchange Link Fixer
- // @namespace mailto:[email protected]
- // @include http://www.thesims3.com/*
- // @include https://www.thesims3.com/*
- // @description Repace Sims 3 Exchange Links
- // ==/UserScript==
- (function() {
- // Override the downloadAsset and loginAndDownload functions
- // which normally pop up a login box
- unsafeWindow.downloadAsset = function(assetId) {
- document.location='sims3://download/?assetId=' + assetId;
- }
- unsafeWindow.loginAndDownload = function(theAction,theAssetId) {
- document.location='sims3://download/?assetId=' + theAssetId;
- }
- // Override the "save file" link so that it is a direct link
- // to the Sims3Pack file :)
- function downloadFeaturedAssetsForMembers(assetId,downloadurl)
- {
- document.getElementById('saveToFileLinkId').href = downloadurl;
- }
- function updateDownloadCountOpenNewWindow(assetID,downloadurl)
- {
- document.getElementById('saveToFileLinkId').href = downloadurl;
- }
- var newline = '';
- var bodyTag = parent.wrappedJSObject.document.getElementsByTagName('body')[0];
- var allLines = bodyTag.innerHTML.split('\n');
- for (var i = 0; i < allLines.length; i++) {
- if (allLines[i].indexOf('updateDownloadCountOpenNewWindow') > -1) {
- eval(allLines[i]);
- }
- if (allLines[i].indexOf('downloadFeaturedAssetsForMembers') > -1) {
- eval(allLines[i].substring(3));
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment