com.github.dennisit.vplus.data.utils.MarkbookUtils Maven / Gradle / Ivy
package com.github.dennisit.vplus.data.utils;
/**
* Created by Elon.su on 2018/5/17.
*/
public class MarkbookUtils {
public static String markPlugin(String rootPath, String context) {
String path = "javascript:(function()%7Bvar%20description;var%20desString=%22%22;var%20metas=document.getElementsByTagName('meta');for(var%20x=0,y=metas.length;x%3Cy;x++)%7Bif(metas%5Bx%5D.name.toLowerCase()==%22description%22)%7Bdescription=metas%5Bx%5D;%7D%7Dif(description)%7BdesString=%22&description=%22+encodeURIComponent(description.content);%7Dvar%20win=window.open(%22"
+ rootPath + context
+ "?from=webtool&url=%22+encodeURIComponent(document.URL)+desString+%22&title=%22+encodeURIComponent(document.title)+%22&charset=%22+document.charset,'_blank');win.focus();%7D)();";
return path;
}
}