Chrome Extension overwrite existing webpage - google-chrome-extension

I will try to make this as short as possible. I am making a Chrome extension and I wanted to have an integrated settings tab so users can customize their experience. Now, I want this settings tab to be somewhat of an "extension" to an existing settings tab in a website. Let me explain.
The website I am talking about is Roblox.com, a popular gaming platform. When logged in, you have the ability to visit your settings, which look something like this:
Now, in order to navigate the different setting "tabs," you simply click on a button and it takes you to another change. The URL corresponding to each page is https://www.roblox.com/my/account#!/TAB_NAME, with TAB_NAME being the name of the tab. What I want to do is make my own "tab" where once the player clicks, it will bring them to a settings tab where they can tweak the extension's settings. This would look something like this:
I am fully aware on how to this (inject a button into the list and customize said button), but what I don't know what to do is make it so that once the button is clicked, it will not redirect you to another website, but will simply "switch tabs" like it would with any other setting. There is an extension that already does that called "Roblox+", where it adds a button to the list, and once clicked, it takes you to a similar-looking page with the URL https://www.roblox.com/my/account?tab=rplus#!/info. From my understanding, since the tab name isn't a header, the URL does not change, which allows for a custom webpage. Now, if you were to paste that URL in a browser without the extension, then it would simply redirect you to the "Account Info" tab (although the URL remains). Here is how the Roblox+ extension settings page looks like:
Now, from what I can assume, what happens is that right after the normal account information page is loaded, it removes all the HTML elements that are related to the account information tab and re-creates the entire page using custom HTML elements. That is something similar to what I want to do. Regardless of this, I do have one question. Is it possible to somehow "overwrite" a certain domain so that, let's say, the URL https://www.roblox.com/my/account#!/my_plugin_settings led to my custom page (even if that means that the page is made from an HTML file) instead of where it was supposed to lead? If that isn't possible, would it be better to create a custom settings page outside of the Roblox website or somehow inject my own into the current settings?
This is the question that I have. Hopefully I explained it well. If someone could assist me on this, then that would be amazing. Thank you for your time and help, I truly appreciate it.

Related

how to script a button that saves the user's websites browsing history in livecode

I need your help
I am programming a URL browsing site when you long press on the button named site01 it will enable you to type a URL, and I need your help in how to script a button that saves the user's websites browsing history and is there a way to know that the website URL which the user has entered is active and correct, I am still a beginner
Check out browserNavigateComplete in the Dictionary. This may enable you to manually record the navigation changes inside the browser object. (i.e. add the URL to a list of sites, or an array for example.)
Also check out the lessons on LiveCode's site, such as: http://lessons.livecode.com/m/4069/l/22836-how-do-i-use-the-browser-control

building chrome extension to read selected words from a web page

I would like to build a chrome extension to allow me select any word from any web page and by clicking a menu item to send it to a service of my company for tracking.
for example, if I am now reading some article on a page, I would like to select a specific word and right click on it, then I would like to make an http request to my service and track this word.
Is it possible to do with chrome extension? can you please link me to a tutorial that can be helpful?
Thanks.
Yes, you can use chrome extension to achieve that.
Refer Official Tutorial for more details.
Per your requirements, you may need:
Select a specific word. window.getSelection()
right click on it. You will need to listen to mousedown, mouseup or contextmenu event, the code looks like
document.addEventListener('contextmenu', function(event){...}, false);
make an http request. You can use XMLHttpRequest to transfer data between client and server.

Netsuite: How do you edit the email preferences page?

I am using Site Builder, and there is currently a less than ideal looking email preferences page.
The url of the page is: https://forms.netsuite.com/app/crm/marketing/campaignlistener.nl?...
Is there a way to edit it somewhere?
There is no way to edit this directly.
Your best option is to inspect the classes and markup used and inject css and scripts (via a tab level tag override) to fix the page.
The other option is to replace the page entirely with a page of your own creation. The problem with that is once you do that you should only allow soft-opt-out because while you can set a hard opt-out with a script you cannot change from a hard opt-out with script.
This is a pain. I think what I may have done in the past was to insert some code on the My Account page that creates an iframe. Then you grab the Subscription Center link and replace it with a Suitelet URL that has the escaped Subscription Center url as a parameter and change its target to the iframe(same domain - forms.netsuite.com))
When the Suitelet opens it uses a postMessage to make the My Account let it take over and then creates another iFrame and makes the source of that iFrame the original Subscription Center iFrame. the Suitelet detects (on open) that the center is open an then because you are in the same domain you can inject CSS. When the subscription center goes away (a new onOpen function sourced from the Suitelet page) you can again use postMessage to "return" to my account.
I think this breaks in Safari but it's such a hack that I have steered away from this sort of thing and these days would tend to roll my own and manage hard opt-outs with the email from the Netsuite GUI.

Can Chrome Extension’s new options_ui trigger a page action?

I’ve been placing a page action on the options page of my Chrome extension. options.js calls chrome.runtime.connect({"name":"someName"}), and background.js has
chrome.runtime.onConnect.addListener(function(port) {
chrome.pageAction.show(port.sender.tab.id);
});
Unfortunately, in the new options_ui with the recommended default (and someday mandatory) "open_in_tab":false, the Sender's tab won't be set. Is there a way to get the tab id in order to show the page action?
I could use tabs.query to get the chrome://extensions/ tab, but that requires the tabs permission, which I currently don’t need. Active tab seems like it would work, but it doesn’t provide the tab id and isn’t enabled by opening an option dialog (source).
(Why do I want the page action on my options page? The extension works with a website that is only available ~7-10 weeks per year. I’d like my users to be able to interact with the extension the rest of the time, so that they can get used to the process. But I don’t want to adjust the displayed extension permissions just to do so. I can accomplish this by having the options page pretend to be the website in question.)

Can I preload content in a Webbrowser control?

I have a VC++ MFC dialog application with a web browser ActiveX control. I have "Next" and "Prev" buttons using which I let the user navigate through a list of pre-defined URLs, whose content are shown in the web browser control. Since I know the list of URLs at the start itself, I would like to pre-load the content in some way while the user is looking at one page, so that when they click on "Next", the content has already been fetched and can be shown to the user instead of waiting for the page to load. I did not find any documentation on how to do that so far. Does anyone have any ideas on how to achieve this? I was thinking of having a second invisible web browser control where I pre-load the next URL, but it would be tricky to handle the user clicking Next when the next URL is still loading in the other browser.

Resources