Skip to content

Implementing the star problem button #1

Open
@cs-mshah

Description

@cs-mshah

I thought of having a separate star for starring the problem under the star which appears on any problem page. Clicking this adds the contest to favourites and not the problem. To add a problem to favourite, we need to go to the contest page and star it there.

But implementing this doesn't seem easy to me. To trigger a click, We need to go to a that page and trigger the click. Simply using load() as I have done (in the problemset.js file) only takes that element and inserts it at the required tag.
But because the chrome API doesn't allow the access to the javascript of a page, the click events from the load() do not get triggered.
Copying the javascript code that you see in the inspect element of that page to the content script and running it also does not work, as the request is forbidden (403 error).

So the only option which is left is to create an <iframe> in the current tab with src=contest page and then triggering the click.
But this method seems too complicated so I wanted to know if there is any other way of doing it. If no, then how should this be implemented efficiently?

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions