How to merge 2 userscripts or replace a script that on Tampermonkey with new version - namespaces

I'd like to describe my problem related to Tampermonkey script.
I created a very basic userscript couple of months ago and a few users installed it.
When I released an update, I changed the namespace from http://example.com to https://example.com not knowing that changing the namespace from http to https will mean a different script.
Now when the users tried to update their first script, they ended up with 2 different version of my script at the same time.. I mean instead of the new version replacing the old version, both versions are now active on my users browser.
How do I solve this problem?
Thanks in advance.

Related

Load remote JS script in Content script for Chrome extension

I have a chrome extension. I have a lot of code in the content script.
Nowadays Google takes a lot of time to publish the extension. About 10-15 days due to covid etc.
I have the same extension on Firefox too where I load all remote code through script injection.
How can I do the same with the Chrome extension? When I try to load the remote script it gives me the following error.
This document requires 'TrustedScript' assignment.
I think Chrome became stricter with the release of version 83.
Also as per ChromeStore support, a wrapper that loads the code remotely is the way to go. But I can't find suitable documentation or a sample code. Questions found on Stackoverflow are about 4-5 years old at minimum.
Also, some of the guys are of opinion that the Chrome store will reject the extension if we inject remote script. But following image belongs to the submission extension UI of Chrome Developer Dashboard.
And you can clearly see that I is saying that does your app requires remote code.
Any help is highly appreciated.

Google Apps scripts called from Google sites now (suddenly) returning 404 error

I have a Google site (https://sites.google.com/site/kitchenergaffers/) which has many pages where scripts are launched. This morning (18 August 2020 EDT) I see that none of the script pages are working and the script seems to be reporting a 404 error of some sort.
The scripts interact with a series of Google sheets
Here is an example of one such page
https://sites.google.com/site/kitchenergaffers/home/general-gaffers-information/publish/directory-of-results?display=directory
=============
404. That's an error.
The requested URL /accounts was not found on this server. That's all we know.
There are many pages that run the same script, and some pages that have different scripts.
All scripts are set to run Anonymously, anyone can execute
Nothing on the site or within the scripts code or Sheets has changed to create this issue.
UPDATE: Although the error comes up using Chrome browser when logged into the creator account, or my personal account if I open an incognito window they run correctly!
UPDATE2: My PC suffered a Windows update yesterday that may be related however, my Chromebook shows the same problem. This problem does not happen if I use Edge browser.
UPDATE3: If I log out of all my accounts, and only sign in to one of them, the problem does not happen. Once I log into an additional account, the problem recurs. Signing out of all, then back into one only is then necessary.
as of 15:00EDT 20 August the issue seems to be resolved. I am not sure if it was something I did experimentally or what, but it has gone.
As it seemed to be related to my account and using Chrome I turned off sync, cleared cookies (also disabling Chrome extensions and bookmarks it seems) then "repaired" or reenabled extensions, resync'd to get the bookmarks from the Chromebook or phone and tried again.
The issue seems to have been resolved - maybe by these actions :)

Publishing a Google Docs Add-on: Project Key is not associated with the current project

I am attempting to publish a simple Google Docs add-on, following these instructions: Publishing an Add-on
However when completing the configuration for Google Apps Marketplace SDK, I enter my script project key (found from file --> project properties) and receive the following error: 'Project Key is not associated with the current project.'
Only instance where I can find someone with the same problem (here) occurred when they created a project on the Google Developers Console instead of going through resources --> Advanced Google Services. This is not the reason for my error, can anyone shred any light onto my problem?
Any help would be gratefully received,
Connor
Kept trying, did not change the way I tried publishing nor the project key I was entering and it worked after so many retries. Wish I could give a more detailed answer...
I was able to fix by combining two successful responses from this post:
use version number, and only the number, e.g. "1" -- Do not use "v1.0" or "Version 1 on Oct 1, 6:10 AM" or your deployment's Description
After completing step 1, delete your entry in field 'Docs Add-On Project Script ID', then re-enter it -- the page seems to not re-evaluate your changes unless you do this; I had tried saving multiple times before doing this with no success using the correct version number and script ID.
For me I need to go Publish->Deploy as API. Select the correct version and then the publish screen worked
I needed to include a correct version number (1,2,3,4; not "v0.1") in addition to the script ID. The error suggested my script ID was wrong, but the error went away when I picked a valid version number.
For me, the Google App Script file needed to be associated with the project.
In the GAS, go to Resources > Cloud Platform Project.
Under Change Project, enter the project number (which can be found on the home page of the Google Cloud Platform Project in the Project info module), and click Set Project.
Confirm the notices (though make sure that is really what you want to do).
Once it has been set, go back to the App Configuration, and re-enter the information (if you are already on that page, refresh).
That's what worked for me, but maybe other developers get that error for other reasons.
Source: https://developers.google.com/apps-script/guides/cloud-platform-projects#switching_to_a_different_standard_gcp_project
Hmm I had issues as well. It didn't work with version 1 in "Docs Add-on script version" but while I tried a bunch of stuff I ended up deploying again and then I incremented version to "2" and then it worked.
I got the same error today, I made it finally work. I will go through the fields I checked.
App Integration [I'm deploying using deployment ID, you can get the ID from AppScript manage deployment]
Choose which workspace you are releasing [In my case Sheets], type the version from AppScript.
Enter all other general Credentials and save.
The above steps worked for me.
Try to use the Google Workspace Add On and enter the App Script Deployment ID. That accepted for me and showed it as a Sheets Add-On
It's different in deploy or test in legacy editor and new editor.
And I'm using legacy editor before
(because some following steps from documents is not work in new editor),
So when I lookup Mange deployment in new editor,
It wasn't exisisted,
And the deployment ID it's not work when I fill out App configuration in Google Workspace Market.
For me I just change to following the Legacy editor's following steps
https://developers.google.com/workspace/marketplace/enable-configure-sdk#legacy-editor_2
and It works.
Looks like it is not possible to change scriptId after a round of review. So you can just update only version. I changed to last number of deployment version like '6' and it is saved.

Google Maps API V3 Infobox.js removed

One of our production pages stopped working properly.
Tracked it down to the fact that one of the dependencies does not exist anymore:
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js
This URL is used in most of the example codes that were the basis of the webpage.
This is probably easily solved but a quick google showed no one has noticed this, I think it has happened in the last hour and just wanted to put the information out there in case people are panicking.
It seems that the library is being moved to Github (it seems the infobox.js wasn't moved yet), see the announcement on main page: https://code.google.com/p/google-maps-utility-library-v3/
But still, the problem with your code is that it's not a good practise to reference code from code.google.com svn repository. It's like referencing a code from Github, it can be changed/moved/removed any time. You should either download the code and include it in your project as .js file or host it yourself on some CDN server.
UPDATE
The google utility library (including infobox) is hosted here on github now. As said before, it's not mean to be referenced from there in projects.
As Google moved the source over to GitHub a while back, the new GitHub version can be accessed from RawGit by using the following script urls (standard and packed versions):
https://cdn.rawgit.com/googlemaps/v3-utility-library/master/infobox/src/infobox.js
https://cdn.rawgit.com/googlemaps/v3-utility-library/master/infobox/src/infobox_packed.js
Whilst the above urls (with the cdn prefixes) have no traffic limits or throttling and the files are served via a super fast global CDN, please bear in mind that RawGit is a free hosting service and offers no uptime or support guarantees.
Accessing files maintained via GitHub is covered in more detail in the following SO answer:
Link and execute external JavaScript file hosted on GitHub
This post also covers that, if you're linking to files on GitHub, in production you should consider targeting a specific release tag to ensure you're getting a specific release version of the script.
For example, you could target the 1.1.13 release of the InfoBox library with the following script urls (standard and packed versions):
https://cdn.rawgit.com/googlemaps/v3-utility-library/infobox/1.1.13/src/infobox.js
https://cdn.rawgit.com/googlemaps/v3-utility-library/infobox/1.1.13/src/infobox_packed.js
Alternatively, you could download and include the library directly in your project for production purposes.
As an emergency fix I copied the code from here:
https://code.google.com/p/google-maps-utility-library-v3/source/browse/trunk/infobox/src/infobox.js?r=466
and linked locally. This appears to work fine for a quick fix but I will need to look for an alternative that see active updates.
Google code is apparently shut down per the announcement
Bidding farewell to Google Code
Thursday, March 12, 2015
January 25, 2016 - The project hosting service is closed. You will be able to download a tarball of project source, issues, and wikis. These tarballs will be available throughout the rest of 2016.
Certainly wasn't clear from the post that they were going to stop making the hosted code available for use externally.
Managed to get back the Infobox (v.1.1.13) script from the browser cache.
Can be downloaded from http://pastebin.com/PGciVVur, hope this helps someone
I linked to this github repo that seems to be a similar one and my site works again:
https://raw.githubusercontent.com/oytunyuksel/Google-Maps-Infobox.js/master/src/infobox.js

Installation for Today extension

I am playing with IOS 8 new features : Today extension. But many times I have to install the main app two times to get new Widgets from my app to display in IOS Today. Does it happen for everyone ? or it just my mistake in configuration.
Thanks,
I think it's safe to say that it's a bug. It has been happening to me all the time with Xcode6b7 and iOS8b5. I found out that I could make the extension appear by pressing 'edit' and removing another extension (such as tomorrow or calendar).
I've got the same issues when I'm trying to update my widget.
Even when I installed my app via the TestFlight app, I had to install it twice to see the updated widget.
It's surely a bug which isn't even fixed in the current Xcode Beta, which I'm using since the release.
But you shouldn't worry whether your updated widget will be installed when the users are updating it via the App Store. When I tried updating my widgets via the App Store, I didn't get any problems.