Greasy Fork is available in English.

[TS] Linx Amender

Generic tracking/redirection/open-in-new-tab removal; Amend page title; URL redirector; and more power functionality. Has rules for Pixiv, deviantArt, twitter, youtube, blogger, Batota etc.

< Feedback on [TS] Linx Amender

Question/comment

§
Posted: 05.05.2015
Edited: 05.05.2015

help with video embed rule

screwed up - see next post...

§
Posted: 05.05.2015

no Flash plugin installed and i want to be able to play embedded video

i found that Firefox will play videos if they are embedded as an iframe, but if they use the embed tag instead, then the browser is asking to install Flash

so i need to convert HTML like this:

<embed src="http://www.youtube.com/v/P9sCshUboug?version=3&amp;hl=en_US" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" height="342" width="608">

into this...

<iframe src="https://www.youtube.com/embed/P9sCshUboug?feature=oembed" allowfullscreen="" height="340" width="604"></iframe>

converting the URL is no problem, but how do i change the opening embed tag to an iframe tag? and add the closing </iframe> tag?

TimidScriptAuthor
§
Posted: 05.05.2015

Hiya,

I really need to write the guide page. Been saying that for months :). What you need to do is edit the element key "outerHTML". You edit object keys by the prefix "=".

Assuming you already have the search-replace to change the src, the rest is something like below:

{"id":"L1430836041895","type":1,"name":"Video Example","nthNode":"0","selectors":"embed","regexes":[{"name":"convertURL","search":"YOUKNOW","replace":"YOUKNOW"},{"name":"=outerHTML","search":"","replace":""}],"enabled":true,"timestamp":1430836041895}


Just replace the convertURL rule first. Hope that makes sense.

(FYI: There is an edit post option under the cog menu on the right side.)

§
Posted: 08.05.2015

strange - i checked this thread today and didn't see your reply - sorry :)

since "src" is not present in your example rule, i really have no idea what i'm doing now

what goes in the outerHTML search and replace?

TimidScriptAuthor
§
Posted: 08.05.2015
Edited: 08.05.2015

I didn't check what came out. It removed all the element tags when posted as it treated it as html. Using markdown should fix the issue.

{"id":"L1430836041895","type":1,"name":"Video Example","nthNode":"0","selectors":"embed","regexes":[{"name":"convertURL","search":"YOUKNOW","replace":"YOUKNOW"},{"name":"=outerHTML","search":"<embed.+src=\"([^\"]+)\".+>","replace":"<iframe src=\"$1\" height=\"340\" width=\"604\"></iframe>"}],"enabled":true,"timestamp":1430836041895}

Copy and paste the above into the Paste Rules dialog. Make changes accordingly. (convertURL rule is the part where you change the src)

Post reply

Sign in to post a reply.