I have a Chrome extension that simply contains a series of content scripts that change an existing page.
This extension is meant to be shared with other users.
But on top of that extension, I want to add more functionality, create another "layer" that will be enabled only to me. And this layer should be able to call methods from that extension.
Is there a way to create this layer as a second extension, but make it somehow reference the other and access its methods? I don't want to copy/paste code and have to update everything twice when necessary.
Related
I have 2 extensions which need to have a specific order on a sitecollection. I already tried setting the in ClientSideInstance.xml and also in Tenant Wide Extensions list.
Do you know other ways to order the rendering of the extensions?
Thank you!
Unfortunately not. There is a parameter in the manifiest.json file, that should allow you which extension should load before, however, it doesn't work.
Some solutions you may try:
One of the extension to leverage the DynamicDataProvider spfx resource, and make the other spfx extension to use the subscrided data.
One of the extension injects some code when it is loaded in the page, like addign an extra class to the body class, as extYYY-loaded. The other extension is monitoring the body attributes using a mutationObserver, and triggers in as soon as the atribute appears.
I’m trying to make a game that has a map editor, and I would like to save layers locally to the file system. Can somebody help me to add this feature? And I also don’t have anything because I don’t know where to start, so I don’t have any code to show.
In JavaScript/HTML5 you cannot save to a file without a user action. You can present the user with a save-file dialog and then save whatever data you have to a file, see this question.
Alternatively, you can just save your layers objects to the local storage, which is storage within the browser cache. The only downside is that if you open the same page in a different browser (for example switch from FireFox to Chrome) then the save is not available. For more information, see this question.
I've been trying to get some unblocked games on my school computer and one way I found out is to run them through an iframe. But I've been asked to add some cheats onto one of the games. So I need to somehow add a chrome extension onto an iframe. Help.
Edit: I don't want to create my own extension but I want to use one I found on GitHub. I also can't add any extensions on my school computer developer mode or not.
Here is the extension i want to use https://github.com/Kalaborative/survivio-plus
I want to generate contentscriptA.js, contentscriptB.js, contentscriptC.js so I can later inject their content on specific sites I visit.
I want to create them after the extension is installed in the browser.
I did not find how to actually create them inside the extension. I've looked into contentscript API and also external libs like chromestore (which only create files in a separate filesystem)
I am making an extension that should include in its background script some variable that should be unique for every user and that must not be altered. I was able to soolve this in Firefox since it is possible to generate the extension package inline and install it with not problems.
As far as chrome is concerned, I cannot rely on cookies, session or localstorage since the can be erased if the user deletes his browsing history.
Then my question is very simple, is it possible to pass the variable when installing the extension from chrome webstore using a link lik this for example :
https://chrome.google.com/webstore/detail/search-by-image-by-google/dajedkncpodkggklbegccjpmnglmnflm?id=somevar
YOu may use Sync Storage in Chrome: https://developer.chrome.com/extensions/storage
It use Google Drive in background to store data. Even if the user clear browser data it will remain intact.
The user will not see this data on Drive because they are not visible in the drive's UI (files are hidden) so probably he will not be able to delete it.
However you must consider a situation when the user is not logged in to Chrome or the user disabled sync options. In this scenario storage.sync will behave like storage.local.
Even when the user clear browsing data, the data stored in storage.local will remain. They will be deleted only on uninstall.
Edit:
Data are stored on Google Drive using syncFileSystem API - not storage.sync. However it doesn't change the solution I wrote.