3 ms·
Show HN: I asked ChatGPT to convert a Chrome ext to a Firefox ext
I told it to create a virtual machine first:
I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do no write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.
Then I told it to create a python script to do the conversion:
{Create and write to the filesystem a python script called convert.py that takes a URL as its first argument. The URL is a chrome extension. The script then converts the extension to a Firefox extension and saves the result in a directory called "res". Make sure the script works with an actual URL to a chrome extension on the Chrome Webstore. It requires you to possibly download the extension first from the URL. Also make sure the generated Firefox extension meets all the requirements and the Chrome to Firefox conversion takes place for all assets in the extension, it includes the content scripts, etc. Only print done to the terminal here when finished.}
Then ran it with this URL (URL to Google Translate Chrome ext):
python convert.py "https://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb?hl=en&gl=BG&authuser=1"
It actually created a zipped Firefox extension with the manifest file converted correctly, etc.
- soheil 4y agoHere is the contents of the manifest file and the `res` dir: { "manifest_version": 2, "name": "Google Translate", "version": "2.1.0.5", "description": "Google Translate is a free multilingual machine translation service developed by Google, to translate text.", "default_locale": "en", "permissions": [ "activeTab", "https://translate.google.com/*", "https://www.google.com/*", "https://www.googleapis.com/*", "https://cloud.google.com/*", "https://policies.google.com/*", "https://clients1.google.com/*", "https://clients2.google.com/*", "https://clients3.google.com/*", "https://clients4.google.com/*", "https://clients5.google.com/*", "https://clients6.google.com/*", "https://clients7.google.com/*", "https://clients8.google.com/*", "https://clients9.google.com/*", "https://clients10.google.com/*", "https://clients11.google.com/*", "https://clients12.google.com/*", "https://clients13.google.com/*", "https://clients14.google.com/*", "https://clients15.google.com/*", "https://clients16.google.com/*", "https://clients17.google.com/*", "https://clients18.google.com/*", "https://clients19.google.com/*", "https://clients20.google.com/*", "https://clients21.google.com/*", "https://clients22.google.com/*", "https://clients23.google.com/*", "https://clients24.google.com/*", "https://clients25.google.com/*", "https://clients26.google.com/*", "https://clients27.google.com/*", "https://clients28.google.com/*", "https://clients29.google.com/*", "https://clients30.google.com/*", "https://clients31.google.com/*", "https://clients32.google.com/*", "https://clients33.google.com/*", "https://clients34.google.com/*", "https://clients35.google.com/*", "https://clients36.google.com/*", "https://clients37.google.com/*", "https://clients38.google.com/*", "https://clients39.google.com/*", "https://clients40.google.com/*", "https://clients41.google.com/*", "https://clients42.google.com/*", "https://clients43.google.com/*", ... ls res extension.xpi
- wizofaus 4y agoAre you saying it did actually dynamically download the assets referred to? It's constantly explaining to me that it doesn't have "live" access to fetch things from the internet... Is ChatGPT actually able generate files that you can then download? I haven't managed to get it to do so. (Rather disappointingly, I just asked for it to do something very simple - generate a text file with an ascii-banner of the word "Hello". It failed, badly, but at any rate, refused to generate a file I could just download. I will say I'm perplexed why it can't give me an even-close-to-correct answer for this at all, given I can even find webpages demonstrating the output of the banner program with the input "hello", e.g. https://www.linuxfordevices.com/tutorials/linux/banner-command https://www.linuxfordevices.com/tutorials/linux/banner-comma...)
- soheil 4y agoYes it did, or at least pretended that it did. It's so good at pretending. It even knows the URL I gave it is the Google Translate Chrome Extension with all its manifest, etc. after it "unzipped" it.
- MollyRealized 4y agoFWIW, the January 9 edition of ChatGPT responds to the above prompt with: I'm sorry, I'm unable to perform the task as described. It is a complex task that involves modifying and creating software on the filesystem. Also, downloading and converting a chrome extension to Firefox is not a trivial task, would require multiple steps, and potentially a lot of complex code. The task you are describing is not something that can be accomplished by a simple command in a terminal, and it is beyond the scope of my capabilities as a language model. I can help you how to write a script or how to use some libraries but i would need more context about the task. (Yes, it lowercases the 'i' in that last sentence.)