Chrome extension, how to Modify page content (add something) [duplicate] - google-chrome

This question already has answers here:
Modify HTML of loaded pages using chrome extensions
(2 answers)
Closed 6 years ago.
I'm new to Chrome extension development, my first project (to learn) is to create an extension that adds some html to another website's existing page.
I plan on creating a 'page' action which fires for a page with a certain URL...
Has anyone seen a tutorial like this, or do you know of an API for adding html to a page?

You can find some example at Google Sample Extension page, however your question seems better answered on this other question.

There are a number of sample extensions on the Chrome extension API site. There are a couple of browserAction examples that will be almost identical to using pageAction.

Related

Opening Chrome App from website (without extension)

I am trying to open a chrome app (this one here- https://chrome.google.com/webstore/detail/text/mmfbcljfglbokpmkimbfghdkjmjhdgbg) from a link/button within a website.
I have found similar posts about this topic but the answers say you need to make your own extension. I have seen in another post that you could use chrome.management.launchApp but I believe that this requires you to make your own extension.
My questions are -
1-Is it possible to do this without an extension
2-If not, is there an extension that is already out there
3-How would you implement a link to a chrome app within a website
I am sorry if my knowledge on this topic is a bit basic as I usually stick to html and css.

Beginner HTML: <iframe> not working as I'd like to [duplicate]

This question already has answers here:
Overcoming "Display forbidden by X-Frame-Options"
(27 answers)
Closed 3 years ago.
so I am still fairly new in coding and started with HTML, because I think it is the easiest and quickest way to get into it.
Im now using w3schools.com to develop my skills and now I am trying to use the iframe tag. When I just used as scr "https://www.google.com" it said, that google is refusing to connect. Then I downloaded the google website and added it to the folder and changed it to scr"google.html" it shows the Page of google, without fancy imaging of Google, which is already an advancment, however, I am unable to actually search something, then I get the error again "Refusing to connect".
Anyone an idea why this is happening and how to solve that?
FYI: My Website is not running on a Server, but I am connected to the Interenet.
Thanks in advance!
Every website can prevent third-party domains from embedding their content.
(How? How to prevent my site page to be loaded via 3rd party site frame of iFrame).
So the problem is not with your code. Google has denied access to embed it inside iframes.

How to let robots parse our custom html elements? [duplicate]

This question already has answers here:
How do search engines deal with AngularJS applications?
(15 answers)
Closed 6 years ago.
I have a website containing custom elements (i use angular 2), and google fails to parse them correctly :
It only sees
<my-app></my-app>
It seems that the value of this component is not retrieved at all by google robots.
Is there a best practice / workaround ?
Thanks for your help.
This has been asked a million times. Please refer to this question and this specific page by google.
Times have changed. Today, as long as you're not blocking Googlebot from crawling your JavaScript or CSS files, we are generally able to render and understand your web pages like modern browsers. To reflect this improvement, we recently updated our technical Webmaster Guidelines to recommend against disallowing Googlebot from crawling your site's CSS or JS files.
What you can do is getting the HTML of your rendered page and inserting it into the <my-app></my-app> tags without user information or the like.
This will get replaced anyway after Angular has booted up, this means you can even put something completely different in there.

How can I access a window variable from a chrome extension? [duplicate]

This question already has answers here:
Chrome extension - retrieving global variable from webpage
(5 answers)
Closed 8 years ago.
How can I access a window variable from a chrome extension?
For example, I want my extension to just log window.variable?
Is this at all possible?
You need to inject the script at runtime (as opposed to doing it from the content script).
From the injected script use either messages to pass it to the extension, or (easier) write what you need in a DOM element and read it from the DOM (but changing the dom might break the original page)
In the official samples shows how to inject the script by writting a tag.
I know this is a dup of the pointed gmail question but that question has a title that makes it hard to know its about injected scripts.

Create my own Google site template Using my own CSS [duplicate]

This question already has an answer here:
How to create a custom Google Sites theme?
(1 answer)
Closed 5 years ago.
Is there a way to create my custom Google site using my own CSS code? I have tried putting <style> but google won't allow me. I can use several inline CSS, but i have noticed that some CSS are not allowed too. e.g position:absolute;
I'm asking this because i can see some websites selling Google site templates. How did they manage to do those template? What language are they using? Is there some sort of software that does it?
Create a code block. This allows you to put HTML/CSS/Javascript into a google site with less restrictions that the edit source feature.